container:docker:dockerhub

This is an old revision of the document!


Docker : Building and Deploying a Docker Image and push it to Docker Hub

This guide walks you through containerizing an application using Docker. You'll write a Dockerfile, build the image, run it as a container, and push it to Docker Hub.

Demo-App
├── Dockerfile
├── index.html
└── nginx.conf

Create a `Dockerfile` in the same directory:

# Use the official Python image
FROM python:3.10-slim
 
# Set working directory
WORKDIR /app
 
# Copy files
COPY . .
 
# Install dependencies
RUN pip install flask
 
# Expose port
EXPOSE 5000
 
# Run the application
CMD ["python", "app.py"]
  • container/docker/dockerhub.1769954902.txt.gz
  • Last modified: 2026/02/01 21:08
  • by 127.0.0.1