Last active
April 3, 2020 08:43
-
-
Save CallMarl/2e573679bc4dd9de0c243c431ff49731 to your computer and use it in GitHub Desktop.
Docker usual command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pull image on local area | |
docker pull image_name | |
# Run image (not persistent) | |
docker run image_name | |
# Display volume | |
docker volume ls | |
# Create volume | |
docker volume create volume_name | |
# Display local image | |
docker image ls | |
# Display runing container | |
docker container ps | |
docker ps | |
# Display all container | |
docker container ps -a | |
docker ps -a | |
# Create container | |
docker create --name container_name image_name | |
# Start container | |
docker start container_name | |
# Restart container | |
docker restart container_name | |
# Stop container | |
docker stop container_name | |
docker stop container_id | |
# Attach to container | |
docker attach container_name | |
# Follow log of container | |
docker logs -f container_name | |
# Exec commande in container | |
docker exec container_name commande | |
# Display existing docker network | |
docker network ls | |
# Inspect details au docker network | |
docker network inspect network_name | |
# Get help about docker | |
docker help | |
docker commande_name help | |
docker commande_name option help | |
# Built image from docker_file | |
docker build -t "image name" ./docker_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run docker compose environnement | |
docker-compose up | |
# Stop docker compose environnement | |
docker-compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create virtual docker machine on virtualbox | |
docker-machine create --driver virtualbox vm_name | |
# Create virtual docker machine on hyperv | |
docker-machine create --driver hyperv --hyperv-virtual-switch vm_name | |
# Get the ip of the docker machine | |
docker-machine ip vm_name | |
# Display commend to setup env var and lind client to the daemon | |
docker-machine env vm_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment