Loading [MathJax]/jax/output/HTML-CSS/jax.js

Tuesday, May 12, 2020

Standard docker command

The following create a new container that redirect traffic to our host 192.168.99.100 at port 3306 into port 3306 of the running container.
1
docker container run -d -p 3306:3306 --name db -e MYSQL_RANDOM_ROOT_PASSWORD=yes mysql
To test linux, we can run another container that run an image of minimal version of ubuntu as follow:
1
docker container run -it --name ubuntu ubuntu
Here -it (i.e., -i and -t) allows us to kind of SSH into the container and get the shell ready. By typing
1
exit
inside the shell we return to our docker prompt. To go back to our shell inside ubuntu container, we run
1
docker container start -ai ubuntu

No comments:

Post a Comment