8000 GitHub - Jakkapan-a/docker-my-web
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Jakkapan-a/docker-my-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to crete a docker image

  1. Create a Dockerfile
FROM nginx:alpine-slim
COPY ./public /usr/share/nginx/html
  1. Build the image
docker build -t toodev/my-web:latest .
  1. Run the image
docker run -d -p 80:80 toodev/my-web:latest --name my-web
  1. Open your browser and go to http://localhost

How to push the image to Docker Hub

  1. Login to Docker Hub
docker login
  1. Tag the image
docker tag toodev/my-web:latest toodev/my-web:latest
  1. Push the image
docker push toodev/my-web:latest

How to pull the image from Docker Hub

  1. Pull the image
docker pull toodev/my-web:latest
  1. Run the image
docker run --name my-web -d -p 80:80 toodev/my-web:latest 
  1. Open your browser and go to http://localhost or http://localhost:80

How to remove the image and container

  1. Stop the container
docker stop my-web
  1. Remove the container
docker rm my-web
  1. Remove the image
docker rmi toodev/my-web:latest

How to remove all images, containers, volumes, networks and cache

  1. Stop all containers
docker stop $(docker ps -a -q)
  1. Remove all containers
docker rm $(docker ps -a -q)
  1. Remove all volumes
docker volume rm $(docker volume ls -q)
  1. Remove all networks
docker network rm $(docker network ls -q)
  1. Remove all images
docker rmi $(docker images -q)
  1. Remove all cache
docker system prune -a

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0