Skip to content

Instantly share code, notes, and snippets.

@atomsfat
Created November 5, 2014 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atomsfat/29293581a2fda7948069 to your computer and use it in GitHub Desktop.
Save atomsfat/29293581a2fda7948069 to your computer and use it in GitHub Desktop.
docker acordeon
boot2docker ip →Get lP
docker info
docker rm <name>
docker stop <name>
docker start <name>
docker attach <name>
docker ps -a
docker logs -f <name>
docker top <name>
docker inspect <name>
docker rm `docker ps -a -q`
docker images
docker pull <image_name>
docker search
docker login
docker commit
-m message
--author
docker build .
-t= repository / name
--no-cache
sudo docker run -i -t ubuntu /bin/bash
-i stdin open
-t pseudo console TTY
-d detach
--name
-p network port exposed
80 -> bind container port 80 to a random host port in the range 9000 to 49900
80:80 -> bind container port 80 to host port 80
127.0,0,1:80:80 -> bind interface on the localhost to container por 80
-P bind all ports specified via EXPOSE in our Dockerfile
-w set working directory
-e pass environment variables
-v DIR_HOST:CONTAINER_PATH create volumes in our container from directory on the host
docker history <hash>
docker rmi < repo/name >
ip a
DOCKERFILE
FROM <image> From what image
MAINTEINER <name “email”> Who build
RUN <CMD> , Also ARRAY Run this
EXPOSE <PORT_NUMBER> Use this container port it could be multiple
CMD [<commands>] Command to run when a container is launched could be override
ENTRYPOINT [<comands>] Hard to be override
WORKDIR <DIR> Provide working directory to ENTRYPOINT and CMD
ENV <NAME> <VALUE> Set enviroment variables to the build process
USER Set should be run as
VOLUME
ADD <route file> <container route> Add directories from build environment into our image, support URL, GZ, ZIP
COPY Same as above but without extraction capabilities.
ONBUILD <instruction> <args> Trigger to images, useful when image is used as the basis of another image
DEBUG
docker run -t -i <hash> /bin/bash
tce-load -wi sshfs-fuse
sudo sshfs <user>@10.0. 2.2:<macpath> localPath
set -o vi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment