Dockerfile links
Reverse engineer a docker run command from an existing container (via docker inspect).
rekcod can turn any of the following into a docker run command:
rekcod will call docker inspect)docker inspect outputdocker inspect output directly)Each docker run command can be used to duplicate the containers.
Quick run:
$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock nexdrew/rekcod <container>
Pull and define alias:
$ docker pull nexdrew/rekcod
$ alias rekcod="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock nexdrew/rekcod"
Pass one or more container names or ids and rekcod will print to stdout a docker run command that duplicates those containers.
rekcod will translate the following docker inspect fields into the listed docker run arguments.
| docker inspect | docker run |
|---|---|
Name | --name |
HostConfig.Privileged | --privileged |
HostConfig.Runtime | --runtime |
HostConfig.Binds | -v |
HostConfig.VolumesFrom | --volumes-from |
HostConfig.PortBindings | -p |
HostConfig.Links | --link |
HostConfig.PublishAllPorts | -P |
HostConfig.NetworkMode | --net |
HostConfig.UTSMode | --uts |
HostConfig.RestartPolicy | --restart |
HostConfig.ExtraHosts | --add-host |
HostConfig.GroupAdd | --group-add |
HostConfig.PidMode | --pid |
HostConfig.SecurityOpt | --security-opt |
Config.Hostname | -h |
Config.Domainname | --domainname |
Config.ExposedPorts | --expose |
Config.Labels | -l |
Config.Env | -e |
Config.Attach* !== true | -d |
Config.AttachStdin | -a stdin |
Config.AttachStdout | -a stdout |
Config.AttachStderr | -a stderr |
Config.Tty | -t |
Config.OpenStdin | -i |
Config.Entrypoint | --entrypoint |
Config.Image || Image | image name or id |
Config.Cmd | command and args |
Get more info here: https://github.com/nexdrew/rekcod
Content type
Image
Digest
Size
78.5 MB
Last updated
over 6 years ago
docker pull nexdrew/rekcod