docker stop -p 8080:8080 -d --env-file docker.env pcre-id:latest
docker stop 12d000d946a0
docker run --name :latest
docker tag /:tag
docker push /
docker commit
docker history
docker inspect : Return low-level information on Docker objects
docker logs
docker diff : Inspect changes to files or directories on a container’s filesystem
docker rm
removing dangling images and containers
docker rm $(docker ps -a -f status=exited -q) : to remove the containers which are unused
docker login --u yourhubusername
docker tag yourhubusername/verse_gapminder:firsttry
Lifecycle
docker create
creates a container but does not start it.docker rename
allows the container to be renamed.docker run
creates and starts a container in one operation.- docker container ls [OPTIONS]
docker rm
deletes a container.docker update
updates a container's resource limits.
Starting and Stopping
docker start
starts a container so it is running.docker stop
stops a running container.docker restart
stops and starts a container.docker pause
pauses a running container, "freezing" it in place.docker unpause
will unpause a running container.docker wait
blocks until running container stops.docker kill
sends a SIGKILL to a running container.docker attach
will connect to a running container.
Info
docker ps
shows running containers.docker logs
gets logs from container. (You can use a custom log driver, but logs is only available forjson-file
andjournald
in 1.10).docker inspect
looks at all the info on a container (including IP address).docker events
gets events from container.docker port
shows public facing port of container.docker top
shows running processes in container.docker stats
shows containers' resource usage statistics.docker diff
shows changed files in the container's FS.
docker ps -a
shows running and stopped containers.docker stats --all
shows a running list of containers.Import / Export
docker cp
copies files or folders between a container and the local filesystem.docker cp 7e5c370eef0c:/usr/bin/AffyAnalysis/R_Workspaces/affy /Users/narendra.raghuwanshi/Documents/affynewdocker run -it --name affyfine f7c545621aa1 /usr/bin/bash
cd /Users/narendra.raghuwanshi/Documents/affynew
docker cp ./affy affyfine:/
docker start affyfine
docker exec -it affyfine /usr/bin/bash- ( docker cp
:/file/path/within/container /host/path/target)
docker cp /Users/narendra.raghuwanshi/Documents/affynew/ 661eb7a0df74:/temp
cp /Users/narendra.raghuwanshi/Documents/TFScode/Rcode/NewR/affy_headmaster.R 2591e5d2023c:/. (for directory)
FROM container to container
First of all, copy file to some temporary directory on the host Next, transfer it from the temp directory to the other container:
docker export
turns container filesystem into tarball archive stream to STDOUT.
Lifecycle
docker images
shows all images.docker import
creates an image from a tarball.docker build
creates image from Dockerfile.docker commit
creates image from a container, pausing it temporarily if it is running.(alway give alias name to ur commit )docker rmi
removes an image.docker load
loads an image from a tar archive as STDIN, including images and tags (as of 0.7).docker save
saves an image to a tar archive stream to STDOUT with all parent layers, tags & versions (as of 0.7).
Info
docker history
shows history of image.docker tag
tags an image to a name (local or registry).docker login
to login to a registry.docker logout
to logout from a registry.docker search
searches registry for image.docker pull
pulls an image from registry to local machine.docker push
pushes an image to the registry from local machine.
where everything stored in our Machine.