Selected topic
Docker Hub
Prefer practical output? Use related tools below while reading.
Docker images are templates used to create containers. They contain the application code, dependencies, and settings needed to run the application.
### Step 1: Create a Docker Hub Account
If you haven't already, create a free account on Docker Hub at [hub.docker.com](https://hub.docker.com/).
### Step 2: Login to Docker CLI
Run the following command in your terminal:
bash
docker login### Step 3: Tag Your Image
Tag your image with your Docker Hub username and the name of your repository. For example, if you want to push an image called my-web-app to your john-doe repository, run:
bash
docker tag my-web-app john-doe/my-web-appPush your tagged image to Docker Hub using the following command:
bash
docker push john-doe/my-web-appdockerfile
FROM node:14WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
CMD ["npm", "start"]
npm start.bash
docker build -t my-web-app .bash
docker tag my-web-app john-doe/my-web-app
docker push john-doe/my-web-appmy-web-app image is now available on Docker Hub!Remember to replace john-doe with your actual Docker Hub username.