docker run image
docker ps
docker ps -a
docker run -ti image bash
docker images
CTRL + P + Q
CTRL + D
docker attach container
docker stats container
docker top container
docker logs container
docker rm container docker rm container -f
docker rm $(docker ps -a) -f
docker run -ti --memory 512m --name container image
docker inspect container | grep -i mem
docker update -m 512m container
docker run -ti --cpu-shares 1024 --name container image
docker update --cpu-shares 512 container
docker run -ti -v path_container image /bin/bash
docker run -ti -v path_host:path_container image
Run container binding host port, giving name, mounting volume from other container and setting environments variables
docker run -d -p port:port --name container --volumes-from container -e env_var1
docker build -t image:version path
docker rm $(docker ps -a -q) -f
docker rmi $(docker images -q) -f
docker login -u user
docker push user/image:version
FROM image
MANTAINER name
ADD file path_host COPY file path_host
CMD ["sh", "-c", "echo", "$HOME"]
LABEL Description="Blablabla"
ENTRYPOINT ["/usr/bin/apache2ctl", "-D", "FOREGROUND"]
ENV var="value"
EXPOSE 80
RUN command_layer1 && command_layer1
USER user_name (root)
WORKDIR path_container
VOLUME path_container