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)

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup 🚀

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay