Back to Cheat SheetsTooling · Intermediate

Docker cheat sheet

Images, containers, compose and running test suites in isolation.

Containers

Run

docker run --rm -p 8080:80 nginx

List / logs

docker ps; docker logs -f <id>

Shell in

docker exec -it <id> sh

Images

Build

docker build -t tests:local .

Dockerfile

FROM mcr.microsoft.com/playwright:v1.49.0-jammy
WORKDIR /app
COPY . .
RUN npm ci
CMD ["npx","playwright","test"]

Compose

Up / down

docker compose up -d && docker compose down -v

Run suite

docker compose run --rm tests

Go beyond the reference

Book a free demo class and apply these commands on live project work.