헤르메스 LIFE

[Docker] Windows10 환경에서 Docker에 Ubuntu 설치 본문

Server

[Docker] Windows10 환경에서 Docker에 Ubuntu 설치

헤르메스의날개 2021. 2. 18. 01:26
728x90

출처 : hwan-shell.tistory.com/178?category=858112

 

도커] Windows 10에서 도커로 우분투 설치하기

우선 windows 10에 있는 powershell을 켜줍니다. 도커를 정상적으로 설치가 됬다면 다음과 같은 그림이 나오게 됩니다. 도커에 대한 명령어 레퍼런스는 https://docs.docker.com/engine/reference/run/#docker-ru..

hwan-shell.tistory.com

Powershell 을 오픈합니다.

1. docker version 확인

2. docker 우분투 찾기

3. docker 우분투 내려받기

4. docker 이미지 확인

5. docker 이미지 생성

6. docker 확인

7. docker 우분투 Container 시작

8. docker 우분투 접속

9. docker 우분투 UPDATE

10. docker 우분투 UPGRADE


1. docker version 확인

PS C:\dockerImages> docker version
Client: Docker Engine - Community
Cloud integration: 1.0.7
Version: 20.10.2
API version: 1.41
Go version: go1.13.15
Git commit: 2291f61
Built: Mon Dec 28 16:14:16 2020
OS/Arch: windows/amd64
Context: default
Experimental: true

Server: Docker Engine - Community
Engine:
Version: 20.10.2
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 8891c58
Built: Mon Dec 28 16:15:28 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.19.0
GitCommit: de40ad0

2. docker 우분투 찾기

PS C:\dockerImages> docker search ubuntu
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
ubuntu Ubuntu is a Debian-based Linux operating sys… 11832 [OK]
dorowu/ubuntu-desktop-lxde-vnc Docker image to provide HTML5 VNC interface … 497 [OK]
websphere-liberty WebSphere Liberty multi-architecture images … 268 [OK]
rastasheep/ubuntu-sshd Dockerized SSH service, built on top of offi… 250 [OK]
consol/ubuntu-xfce-vnc Ubuntu container with "headless" VNC session… 232 [OK]
ubuntu-upstart Upstart is an event-based replacement for th… 110 [OK]
neurodebian NeuroDebian provides neuroscience research s… 80 [OK]
1and1internet/ubuntu-16-nginx-php-phpmyadmin-mysql-5 ubuntu-16-nginx-php-phpmyadmin-mysql-5 50 [OK]
ubuntu-debootstrap debootstrap --variant=minbase --components=m… 44 [OK]
open-liberty Open Liberty multi-architecture images based… 42 [OK]
i386/ubuntu Ubuntu is a Debian-based Linux operating sys… 24
1and1internet/ubuntu-16-apache-php-5.6 ubuntu-16-apache-php-5.6 14 [OK]
1and1internet/ubuntu-16-apache-php-7.0 ubuntu-16-apache-php-7.0 13 [OK]
1and1internet/ubuntu-16-nginx-php-phpmyadmin-mariadb-10 ubuntu-16-nginx-php-phpmyadmin-mariadb-10 11 [OK]
1and1internet/ubuntu-16-nginx-php-5.6 ubuntu-16-nginx-php-5.6 8 [OK]
1and1internet/ubuntu-16-nginx-php-5.6-wordpress-4 ubuntu-16-nginx-php-5.6-wordpress-4 8 [OK]
1and1internet/ubuntu-16-apache-php-7.1 ubuntu-16-apache-php-7.1 6 [OK]
darksheer/ubuntu Base Ubuntu Image -- Updated hourly 5 [OK]
1and1internet/ubuntu-16-nginx-php-7.0 ubuntu-16-nginx-php-7.0 4 [OK]
pivotaldata/ubuntu A quick freshening-up of the base Ubuntu doc… 4
pivotaldata/ubuntu16.04-build Ubuntu 16.04 image for GPDB compilation 2
1and1internet/ubuntu-16-php-7.1 ubuntu-16-php-7.1 1 [OK]
pivotaldata/ubuntu-gpdb-dev Ubuntu images for GPDB development 1
1and1internet/ubuntu-16-sshd ubuntu-16-sshd 1 [OK]
smartentry/ubuntu ubuntu with smartentry 1 [OK]

3. docker 우분투 내려받기

PS C:\dockerImages> docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
83ee3a23efb7: Pull complete
db98fc6f11f0: Pull complete
f611acd52c6c: Pull complete
Digest: sha256:703218c0465075f4425e58fac086e09e1de5c340b12976ab9eb8ad26615c3715
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest

4. docker 이미지 확인

PS C:\dockerImages> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest f63181f19b2f 3 weeks ago 72.9MB
docker/getting-started latest 3c156928aeec 10 months ago 24.8MB

5. docker 이미지를 Container 파일로 생성

PS C:\dockerImages> docker create -it --name ubuntu_server ubuntu
d5a728a317838c513945d00d1643d3a27393e8939d109bb0c8e496594e1a9af0

6. docker 확인

PS C:\dockerImages> docker ps -a
CONTAINER ID   IMAGE                      COMMAND                 CREATED          STATUS     PORTS     NAMES
d5a728a31783    ubuntu                     "/bin/bash"                  21 seconds ago  Created                  ubuntu_server
b3f6c4aea5ef     docker/getting-started  "nginx -g 'daemon of…" 23 hours ago     Created                  strange_lumiere
96fd78b88620    docker/getting-started  "nginx -g 'daemon of…" 23 hours ago     Exited (255) 27 minutes ago 0.0.0.0:80->80/tcp jovial_carver

7. docker 우분투 Container 시작

PS C:\dockerImages> docker start ubuntu_server
ubuntu_server

8. docker 우분투 접속

PS C:\dockerImages> docker attach ubuntu_server
root@d5a728a31783:/# ls
bin boot dev etc home lib lib32 lib64 libx32 media mnt opt proc root run sbin srv sys tmp usr var
root@d5a728a31783:/# cat etc/issue
Ubuntu 20.04.1 LTS \n \l

9. docker 우분투 UPDATE

root@d5a728a31783:/# apt-get update
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [13.3 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [612 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
Get:8 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [165 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [664 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [198 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1020 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [21.1 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [926 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [4301 B]
Fetched 17.0 MB in 1min 9s (248 kB/s)
Reading package lists... Done

10. docker 우분투 UPGRADE

root@d5a728a31783:/# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
apt base-files gpgv libapt-pkg6.0 libc-bin libc6
6 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 5735 kB of archives.
After this operation, 2048 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6 amd64 2.31-0ubuntu9.2 [2715 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 base-files amd64 11ubuntu5.3 [60.6 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc-bin amd64 2.31-0ubuntu9.2 [639 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libapt-pkg6.0 amd64 2.0.4 [833 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gpgv amd64 2.2.19-3ubuntu2.1 [199 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apt amd64 2.0.4 [1289 kB]
Fetched 5735 kB in 26s (219 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 4121 files and directories currently installed.)
Preparing to unpack .../libc6_2.31-0ubuntu9.2_amd64.deb ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module)
(@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-
gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base)
at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Unpacking libc6:amd64 (2.31-0ubuntu9.2) over (2.31-0ubuntu9.1) ...
Setting up libc6:amd64 (2.31-0ubuntu9.2) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module)
(@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-
gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base)
at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
(Reading database ... 4121 files and directories currently installed.)
Preparing to unpack .../base-files_11ubuntu5.3_amd64.deb ...
Unpacking base-files (11ubuntu5.3) over (11ubuntu5.2) ...
Setting up base-files (11ubuntu5.3) ...
Installing new version of config file /etc/issue ...
Installing new version of config file /etc/issue.net ...
Installing new version of config file /etc/lsb-release ...
(Reading database ... 4121 files and directories currently installed.)
Preparing to unpack .../libc-bin_2.31-0ubuntu9.2_amd64.deb ...
Unpacking libc-bin (2.31-0ubuntu9.2) over (2.31-0ubuntu9.1) ...
Setting up libc-bin (2.31-0ubuntu9.2) ...
(Reading database ... 4121 files and directories currently installed.)
Preparing to unpack .../libapt-pkg6.0_2.0.4_amd64.deb ...
Unpacking libapt-pkg6.0:amd64 (2.0.4) over (2.0.2ubuntu0.2) ...
Setting up libapt-pkg6.0:amd64 (2.0.4) ...
(Reading database ... 4121 files and directories currently installed.)
Preparing to unpack .../gpgv_2.2.19-3ubuntu2.1_amd64.deb ...
Unpacking gpgv (2.2.19-3ubuntu2.1) over (2.2.19-3ubuntu2) ...
Setting up gpgv (2.2.19-3ubuntu2.1) ...
(Reading database ... 4121 files and directories currently installed.)
Preparing to unpack .../archives/apt_2.0.4_amd64.deb ...
Unpacking apt (2.0.4) over (2.0.2ubuntu0.2) ...
Setting up apt (2.0.4) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...

 

728x90