Search Suggest

Bài đăng

Some useful docker command

Copy file/directory to Docker container
docker cp local_dir container_name:container_dir

Execute linux command to Docker container from host machine
docker exec -it container_name "linux-command-here"


Share host directory to Docker container
docker run -itd -v {host-folder-path}:{container-folder-path} --name {container-name} {image-name/id}

Create a new image from existing Docker container
docker commit {existing-container-name} {existing-image-name:new-image-tag}

Create a new container from an exiting image
docker run -itd --name {new-container-name} -p source-port:destination-port {image-name/id}

Đăng nhận xét