Posts

Showing posts from March, 2017

docker usage tips

Docker is really a smart way to hold projects with different environment settings. Below are some basic but must know cmds when using docker: docker-compose is the name of the .yml file that used as the setting file for an app implemented in docker: 1. Start an app: sudo docker-compose up Notice when using like this, there is only one app info in the docker-compose file.  And then you will have the log console window keep running, means get the real time log info. sudo docker-compose up -d Notice -d option will run the docker container as a background app, and will not have server log info be displayed. 2. Stop an app: sudo docker-compose stop If any modification of the code, then need to "stop" and "up" the app.   3. Show the running containers: sudo docker ps Can get "CONTAINER ID", "IMAGE NAMES" and other basic info for all the running containers. 4. Show the server log file: sudo docker logs CONTAINER_ID Or use the docke