Docker settings and this and that

Introduction

Summarize the introduction of Docker and the commands used in Windows 10 Pro For Windows10 Home, since Hyper-V cannot be used, it will be a different procedure, so please refer to the reference site

Introduction flow

  1. Windows function settings

  2. Right-click on the Windows key and select Apps & Features 2021-01-09-17-32-28.png

  3. Select Programs and Features 2021-01-09-17-33-55.png

  4. Select Turn Windows features on or off 2021-01-09-17-35-41.png

  5. Select Hyper-V 2021-01-09-17-39-30.png

  6. Select Windows Subsystem for Linux 2021-01-09-19-28-26.png

  7. Install the WSL2 Linux kernel update program package

  8. Download the latest version of the package from Microsoft Docs 2021-01-09-19-31-17.png

  9. Download Docker Go to Sites (https://hub.docker.com/editions/community/docker-ce-desktop-windows/) and select Get Docker 2021-01-09-19-13-58.png

  10. Installation

  11. Select Docker Desktop Installer.exe 2021-01-09-19-16-25.png

  12. Config settings Use with default settings 2021-01-09-19-18-00.png

command

Basic commands

# hello-world
docker run hello-world
#Download Docker image
docker pull [image name]
#Get a list of Docker images you own
docker images
#Get the currently running Docker container
docker ps
#Get all Docker containers you own
docker ps -a
#Delete Docker container
docker rm [Container ID]
#Delete Docker image
docker rmi [image name]
#Stop Docker container
docker stop [Container Name]
#Run Docker container(Second time)
docker start [Container Name]
#Get Docker Version
docker --version

docker run command

#Specifying the Docker container name
docker --name [Container Name] [Image Name]
#Communicate interactively
docker -it [Container Name]
#Run Docker container in background
docker -d [Container Name]
#External access to Docker container
docker run -p [External port]:[Container port]

Docker virtual disk size optimization (at your own risk)

wsl --shutdown
cd %LocalAppData%\Docker\wsl\data\ext4.vhdx
Optimize-VHD -Path .\ext4.vhdx -Mode full

Reference link

--Docker official documentation: Docker Docs --Shared Docker image: Docker Hub --Hyper-V Activation Official Documentation: Microsoft Docs

Recommended Posts

Docker settings and this and that
[Rails] strftime this and that
Digital certificate this and that
Base64 encoder this and that
This and that of the JDK
This and that of Core Graphics
This and that about Base64 (Java)
This and that of exclusive control
This and that of Swift corner Radius
This and that of conditional branching of rails development
CI/CD pipeline and Docker
Docker installation and initialization
Docker terms and commands
Php settings with Docker
This and that for editing ini in Java. : inieditor-java
Overview of Docker and containers
Docker Compose basics and commands
Latest docker installation (Ubuntu 20.04 and Ubuntu 20.10)
I tried to verify this and that of Spring @ Transactional
Docker autostart settings with wsl2
Installing and building Docker (memo)
Hello World with Docker and C
MongoDB installation and authentication settings (Ubuntu18.04)
[Rails] Validation settings and Japanese localization
2. Create Docker image and register Registry
Microservices With Docker and Cloud Performance
Challenge to install WSL2 and docker
String operations this and that-Java edition-
About Docker, disguise server and container
A shell script that builds a Docker image and pushes it to ECR
This and that of the implementation of date judgment within the period in Java
Launching the production environment with docker + rails (ver5.2) and errors that occurred