BUILD
sudo docker build --tag <image-name> --build-arg argument=value .
sudo docker build --tag <image-name> --build-arg argument=value .
REMOVE:
image: docker rmi <image-name>
container: docker rm <container-name>
all-image: docker rmi $(sudo docker images -qf "dangling=true")
all-container: docker rm $(sudo docker ps -aq)
LIST:
images: docker images
containers: docker ps -a
RUN:
docker run --name <container-name-once-it-runs> -ti <image-name> /bin/bash
EXEC:
sudo docker exec -ti <container-name> /bin/bash
e.g. sudo docker exec <container-name> /bin/sh -c "echo 172.17.0.2 dockerelk_logstash_1 >> /etc/hosts"
Get IP address:
sudo docker inspect --format '{{ .NetworkSettings.IPAddress }}' <container-name>
No comments:
Post a Comment