Source: jorgepit-14189.medium.com

Docker Commands Cookbook

Category: Docker, shell

Get a list of all of the Docker commands: Create a container and attach to it: Create a container and run it in the background: Create a container that you name and run it in the background: How to expose ports on a container, as well as how to publish them.

Commands can be: Start a container with a command: Execute a command on a container: Example: List all Docker volume commands: Create new volumes: Get t he flags available when creating a volume: Inspecting a volume: Deleting a volume: Removing all unused volumes: Bind mounts have been around since the early days of Docker.

USER: Sets the user name (or UID) and optionally the user group (or GID) to use when running the image and for any RUN, CMD, and ENTRYPOINT instructions that follow it in the Dockerfile WORKDIR: Sets the working directory for any RUN, CMD, ENTRYPOINT, COPY, and ADD instructions that follow it in the Dockerfile

HEALTHCHECK: Tells Docker how to test a container to check that it is still working

Related Articles