Skip to content
Eric Muller edited this page Dec 18, 2022 · 11 revisions

install postgres container

docker run --name qcm-postgres -p 5433:5432 -e POSTGRES_PASSWORD=postgres -d postgres:10.12 --restart unless-stopped

test postgres container connection psql

docker exec -it qcm-postgres bash

''' su postgres

psql

\conninfo

\q '''

remove postgres container

docker stop qcm-postgres

docker rm qcm-postgres

docker system prune

useful command

docker ps

list all containers

docker container ls -a

start one container

docker container start qcm-postgres

update one container

docker container update qcm-postgres --restart unless-stopped

build project app image

mvn clean package -Dmaven.test.skip=true docker build -t ericmuller//qcm-rest-app ./qcm-app

run app image

docker run --name /qcm-rest-app -p 8080:8081 -d # ericmuller//qcm-rest-app

rem docker exec -it qcm-rest-app bash

rem docker history --format "{{.ID}} {{.CreatedBy}} {{.Size}}" qcm-rest-api

clean one unused image

docker rmi $(docker images ericmuller/qcm-rest-app -q)

docker rmi -f $(docker images ericmuller/qcm-rest-app -q) # forceful deletion

clean unused image

docker volume prune

Clone this wiki locally