- æ¤è¨¼ç°å¢
- å¤ããã¼ã¸ã§ã³ã®ã¢ã³ã¤ã³ã¹ãã¼ã«
- ãªãã¸ããªã®ã»ããã¢ãã
- Docker ã¨ã³ã¸ã³ã®ã¤ã³ã¹ãã¼ã«
- ã¦ã¼ã¶ã¼ã®ã°ã«ã¼ã追å
- config ãã¡ã¤ã«ã®ä½æ
- docker ãã¼ã¢ã³ã®ãªã¹ã¿ã¼ã
- åä½ç¢ºèª
- åèãµã¤ã
æ¤è¨¼ç°å¢
Windows11 Home Edition (version 22H2) D:\>wsl --version WSL ãã¼ã¸ã§ã³: 1.2.5.0 ã«ã¼ãã« ãã¼ã¸ã§ã³: 5.15.90.1 WSLg ãã¼ã¸ã§ã³: 1.0.51 MSRDC ãã¼ã¸ã§ã³: 1.2.3770 Direct3D ãã¼ã¸ã§ã³: 1.608.2-61064218 DXCore ãã¼ã¸ã§ã³: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows ãã¼ã¸ã§ã³: 10.0.22621.1555 # installed ubuntu version Ubuntu 22.04.2 LTS (Jammy Jellyfish)
å¤ããã¼ã¸ã§ã³ã®ã¢ã³ã¤ã³ã¹ãã¼ã«
Docker ãã¤ã³ã¹ãã¼ã«æ¸ã¿ã®å ´åãå¤ããã¼ã¸ã§ã³ãã¢ã³ã¤ã³ã¹ãã¼ã«ãã
$ sudo apt-get remove docker docker-engine docker.io containerd runc
ãªãã¸ããªã®ã»ããã¢ãã
$ sudo apt-get update -y $ sudo apt-get install -y \ ca-certificates \ curl \ gnupg $ sudo install -m 0755 -d /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg $ sudo chmod a+r /etc/apt/keyrings/docker.gpg $ echo \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Docker ã¨ã³ã¸ã³ã®ã¤ã³ã¹ãã¼ã«
$ sudo apt-get update -y $ sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
ã¦ã¼ã¶ã¼ã®ã°ã«ã¼ã追å
sudo
ãªã㧠docker
ã³ãã³ããå®è¡ã§ããããã«ã¦ã¼ã¶ã¼ã docker ã°ã«ã¼ãã¸è¿½å ãã
$ sudo gpasswd -a <username> docker
ãã°ã¢ã¦ãå¾ãåãã°ã¤ã³ããã¨è¨å®ãåæ ããã
config ãã¡ã¤ã«ã®ä½æ
$ sudo mkdir -p /etc/systemd/system/docker.service.d $ sudo touch /etc/systemd/system/docker.service.d/options.conf $ sudo echo '[Service]' | sudo tee /etc/systemd/system/docker.service.d/options.conf $ sudo echo 'ExecStart=' | sudo tee --append /etc/systemd/system/docker.service.d/options.conf $ sudo echo 'ExecStart=/usr/bin/dockerd -H unix://' | sudo tee --append /etc/systemd/system/docker.service.d/options.conf $ sudo touch /etc/docker/daemon.json $ sudo echo '{"log-driver":"json-file","log-opts":{"max-size":"10m","max-file":"3"}}' | sudo tee /etc/docker/daemon.json $ sudo chmod 600 /etc/docker/daemon.json
docker ãã¼ã¢ã³ã®ãªã¹ã¿ã¼ã
config ãã¡ã¤ã«ãåæ ããããã docker ãã¼ã¢ã³ããªã¹ã¿ã¼ãããã
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
åä½ç¢ºèª
$ docker -v Docker version 23.0.4, build f480fb1 $ docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 2db29710123e: Pull complete Digest: sha256:4e83453afed1b4fa1a3500525091dbfca6ce1e66903fd4c01ff015dbcb1ba33e Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/ $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello-world latest feb5d9fea6a5 19 months ago 13.3kB