Skip to content

mschurenko/docker-cloner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-cloner

release CircleCI

This small Go program will "clone" a running docker container by fetching the running container's metadata and then creating a new container. The new container id will be written to stdout. If there are any errors an exit code of 1 will be returned. A few common attributes (command, entrypoint, etc can be overriden). Run docker-cloner -h for more info.

The new container will be in a stopped state (use docker ps -a to see it). Use docker start <new_container_id> to start it.

Example Usage

container_id=$(docker-cloner -memory 200 -id <running_container_name> -cmd "echo arg1 arg2" -new_name <clone_of_running_container>)
docker start -ia $container_id