본문 바로가기

MicroService 구현을 위한 Docker & Kubernetes/Docker

Docker 환경설정


가상머신 생성하기
File > new virtual machine > custom
Choose th virtual machine
hardware compatibility hw : comaptibility 17.x 선택
Guest Operating System Installation
I will install the operating system later
Select a Guest Operating System
linux > ubuntu 64bit >
Name the virtual machine
virtual machine name : docker-00
Location : D:\data\vm\docker-00
Processor Configuration : 2 , 1
Memory for the virtual machine : 4096MB
Network Type Network Connection : NAT
Sellect I/O Controller Types
LSI Logic
Virtual Disk Type
SCSI
Disk Create New Virtual Disk >
Specify Disk Capacity
60GB
체크 하지마 !!!! allocate all space now
store virtual disk as a single file
Specify Disk File
docker-00.vmdk
Ready to Create Vritual Machine > Finish
edit virtual machine settings > usb,sound card, printer 제거
Network adpter
network connection > NAT
Advaced > MAC Address > Generate > 맥주소 편집

test01@test01-virtual-machine:~/바탕화면$ su -
암호: 
su: 인증 실패
test01@test01-virtual-machine:~/바탕화면$ sudo passwd root
[sudo] test01 암호: 
새  암호: 
새  암호 재입력: 
passwd: 암호를 성공적으로 업데이트했습니다
test01@test01-virtual-machine:~/바탕화면$ su -
암호: 
root@test01-virtual-machine:~# exit
로그아웃
test01@test01-virtual-machine:~/바탕화면$
test01@test01-virtual-machine:~$ sudo apt-get update
test01@test01-virtual-machine:~$ ifconfig

명령어 'ifconfig' 을(를) 찾을 수 없습니다. 그러나 다음을 통해 설치할 수 있습니다:

sudo apt install net-tools
test01@test01-virtual-machine:~$ sudo apt install net-tools
test01@test01-virtual-machine:~$ ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.0.200  netmask 255.255.255.0  broadcast 172.16.0.255
        inet6 fe80::20c:29ff:fefe:87e3  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:fe:87:e3  txqueuelen 1000  (Ethernet)
        RX packets 1652  bytes 1630166 (1.6 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 853  bytes 94039 (94.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 312  bytes 27712 (27.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 312  bytes 27712 (27.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
test01@test01-virtual-machine:~$ sudo apt install openssh-server 
test01@test01-virtual-machine:~$ sudo systemctl restart ssh
test01@test01-virtual-machine:~$ sudo systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2024-04-30 11:12:41 KST; 16s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 5813 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
   Main PID: 5814 (sshd)
      Tasks: 1 (limit: 4564)
     Memory: 1.0M
     CGroup: /system.slice/ssh.service
             └─5814 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups

 4월 30 11:12:41 test01-virtual-machine systemd[1]: Starting OpenBSD Secure Shell server...
 4월 30 11:12:41 test01-virtual-machine sshd[5814]: Server listening on 0.0.0.0 port 22.
 4월 30 11:12:41 test01-virtual-machine sshd[5814]: Server listening on :: port 22.
 4월 30 11:12:41 test01-virtual-machine systemd[1]: Started OpenBSD Secure Shell server.

mobaxterm 접속 테스트
VMware 네트워크 정리

test01@test01-virtual-machine:~/바탕화면$ sudo ufw status
[sudo] test01 암호: 
상태: 비활성
test01@test01-virtual-machine:~/바탕화면$ sudo ufw disable
방화벽이 비활성 되었으며 시스템이 시작할 때 사용되지 않습니다
test01@test01-virtual-machine:~/바탕화면$ sudo ufw status
상태: 비활성
test01@test01-virtual-machine:~/바탕화면$ sudo apt install iptables-persistent
test01@test01-virtual-machine:~/바탕화면$ sudo apt-get install ca-certificates curl gnupg lsb-release 
test01@test01-virtual-machine:~/바탕화면$ sudo apt install vim

환경설정 후 스냅샷