DEV Community

Ibrahim S
Ibrahim S

Posted on

Docker Commands - Basic

  1. FROM: Specifies the base image for subsequent instructions.
  2. COPY: Copies files or directories from the host into the container.
  3. RUN: Executes commands in the container during image build.
  4. CMD: Defines the default command to run when the container starts.
  5. EXPOSE: Exposes ports for networking between the container and host.
  6. ENV: Sets environment variables in the container.
  7. WORKDIR: Sets the working directory for subsequent instructions.
  8. VOLUME: Creates a mount point and makes it accessible from the container.
  9. ENTRYPOINT: Specifies the command to run when the container starts, overriding CMD.
  10. ARG: Defines build-time arguments for Docker builds.
  11. LABEL: Adds metadata to an image.
  12. USER: Sets the user or UID to run container processes.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay