Docker - LePingu/umla_project GitHub Wiki

Successfully building an application in Docker

Building the application

The building of the application can be run through

docker build -t lepingu/umla-back .

t is used for tagging

Running an image in the containers

Once the building of images has successfully finished, run

docker run --name application_name -p 80:1337 -d user_name/application_name

  • p specifies the port assignation on the containerised app
  • d for running in background

Address

To obtain the IP address of a container running, it is possible to execute

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' name_of_app

Memos

Listing

Listing images

docker images

Listing containers

docker ps

Running an application

React application

docker run -it -v ${pwd}:/docker_directory -v /docker_directory/node_modules -p port_host:port_container image_to_run

Killing an application and removing containers/images

Killing images entirely

docker kill $(docker ps -q)

Delete stopped containers

docker rm $(docker ps -a -q)

Delete images

docker rmi $(docker images -q)