Thursday, 2 May 2019

Docker cheatsheet

List all running and stopped containers

docker ps -a

Remove a container

docker rm my_container

Stop a container

docker stop my_container

Start a container

docker start my_container

Run a container

docker run --name sonarqube\
    -p 9000:9000 \
    -e sonar.jdbc.username=sonarqube \
    -e sonar.jdbc.password=password \
    -e sonar.jdbc.url="jdbc:mysql://host.docker.internal:3306/sonarqube?useUnicode=true&characterEncoding=utf8" \
    sonarqube
Use -d to run it in background

No comments:

Post a Comment