Create a Docker File and using Docker file Build Images
PreviousSome Best practices for using Docker in application development include:NextDocker Container
Last updated
mkdir docker_configcd docker_config touch Dockerfilevi Dockerfile# Use a base image from Docker Hub
FROM alpine:latest
# Set the working directory in the container
WORKDIR /app
# Copy files from the host machine to the container
COPY . /app
# Install necessary dependencies
RUN apk add --no-cache python3
# Expose a port
EXPOSE 80
# Define a default command to run when the container starts
CMD ["python3", "app.py"]chown $USER /var/run/docker.sockdocker build -t my-image .docker imagesdocker rmi image_name/imgae_iddocker image lsdocker tag image_name/image_id tag_name