728x90
반응형

docker-compose install

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

 

docker-compose 권한 부여

sudo chmod +x /usr/local/bin/docker-compose

 

docker-compose 버전 확인

docker-compose --version

 

실행 

 

728x90
반응형
728x90
반응형

Ubuntu Repository update

sudo apt-get update

sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
    
    
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg    

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Docker Engine 설치

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
#  sudo apt-get install docker-ce docker-ce-cli containerd.io
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  docker-ce-rootless-extras docker-scan-plugin git git-man liberror-perl pigz slirp4netns
Suggested packages:
  aufs-tools cgroupfs-mount | cgroup-lite git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
  containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras docker-scan-plugin git git-man liberror-perl pigz slirp4netns
0 upgraded, 10 newly installed, 0 to remove and 23 not upgraded.
Need to get 104 MB of archives.
After this operation, 448 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://download.docker.com/linux/ubuntu focal/stable amd64 containerd.io amd64 1.5.10-1 [24.9 MB]
..... 중략
Setting up git (1:2.25.1-1ubuntu3.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.15) ...

Docker Version 선택 설치 

도커는 버전별로 선택해서 설치를 진행 할수 있습니다. 

설치 가능 버전 확인후 선택해서 설치를 진행하면 됩니다. 

설치 버전 확인 

apt-cache madison docker-ce
 docker-ce | 5:20.10.13~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.12~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.11~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.10~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.9~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.8~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.7~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.6~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.5~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.4~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.3~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.2~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.1~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:20.10.0~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:19.03.15~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:19.03.14~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:19.03.13~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:19.03.12~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:19.03.11~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:19.03.10~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
 docker-ce | 5:19.03.9~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages

Docker 버전 선택 설치 

#sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io
sudo apt-get install docker-ce=5:19.03.15~3-0~ubuntu-focal docker-ce-cli=5:19.03.15~3-0~ubuntu-focal containerd.io

Docker 중지/시작 명령어 

#도커 재시작 
service docker restart

#도커 중지 
service docker stop


#도커 시작 
service docker start

Docker 상태 확인

docker ps -a
728x90
반응형
728x90
반응형

우분투 서버에 다른 PC에서 SSH로 접속하는 방법에 대해 알아보겠습니다. 

제가 설치한 우분투 버전은 Ubuntu 20.04.4 LTS 입니다. 

지금부터 설치와 접속 방법에 대해 소개하겠습니다. 

 

Open ssh Server Install 

sudo apt update

sudo apt install openssh-server

 

min@min-server:~/바탕화면$ su - root
암호: 
root@min-server:~# apt update
기존:1 https://dl.google.com/linux/chrome/deb stable InRelease
받기:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]                                  
기존:3 http://kr.archive.ubuntu.com/ubuntu focal InRelease                                            
받기:4 http://kr.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]                           
받기:5 http://kr.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
받기:6 http://kr.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [616 kB]
받기:7 http://kr.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,642 kB]
받기:8 http://kr.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [23.8 kB]
받기:9 http://kr.archive.ubuntu.com/ubuntu focal-updates/multiverse i386 Packages [8,460 B]
내려받기 2,627 k바이트, 소요시간 3초 (800 k바이트/초)           
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
패키지 23이(가) 업그레이드되었습니다. 'apt list --upgradable'를 실행하여 확인해 보십시오.
root@min-server:~# sudo apt install openssh-server
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
다음의 추가 패키지가 설치될 것입니다 :
  ncurses-term openssh-sftp-server ssh-import-id
제안하는 패키지:
  molly-guard monkeysphere ssh-askpass
다음 새 패키지를 설치할 것입니다:
  ncurses-term openssh-server openssh-sftp-server ssh-import-id
0개 업그레이드, 4개 새로 설치, 0개 제거 및 23개 업그레이드 안 함.
688 k바이트 아카이브를 받아야 합니다.
이 작업 후 6,010 k바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까? [Y/n] y
받기:1 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 ncurses-term all 6.2-0ubuntu2 [249 kB]
받기:2 http://kr.archive.ubuntu.com/ubuntu focal-updates/main amd64 openssh-sftp-server amd64 1:8.2p1-4ubuntu0.4 [51.5 kB]
받기:3 http://kr.archive.ubuntu.com/ubuntu focal-updates/main amd64 openssh-server amd64 1:8.2p1-4ubuntu0.4 [377 kB]
받기:4 http://kr.archive.ubuntu.com/ubuntu focal/main amd64 ssh-import-id all 5.10-0ubuntu1 [10.0 kB]
내려받기 688 k바이트, 소요시간 2초 (284 k바이트/초)
패키지를 미리 설정하는 중입니다...
Selecting previously unselected package ncurses-term.
(데이터베이스 읽는중 ...현재 194432개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../ncurses-term_6.2-0ubuntu2_all.deb ...
Unpacking ncurses-term (6.2-0ubuntu2) ...
Selecting previously unselected package openssh-sftp-server.
Preparing to unpack .../openssh-sftp-server_1%3a8.2p1-4ubuntu0.4_amd64.deb ...
Unpacking openssh-sftp-server (1:8.2p1-4ubuntu0.4) ...
Selecting previously unselected package openssh-server.
Preparing to unpack .../openssh-server_1%3a8.2p1-4ubuntu0.4_amd64.deb ...
Unpacking openssh-server (1:8.2p1-4ubuntu0.4) ...
Selecting previously unselected package ssh-import-id.
Preparing to unpack .../ssh-import-id_5.10-0ubuntu1_all.deb ...
Unpacking ssh-import-id (5.10-0ubuntu1) ...
openssh-sftp-server (1:8.2p1-4ubuntu0.4) 설정하는 중입니다 ...
openssh-server (1:8.2p1-4ubuntu0.4) 설정하는 중입니다 ...
Creating config file /etc/ssh/sshd_config with new version
Creating SSH2 RSA key; this may take some time ...
3072 SHA256:oN/4NemlZx06om65/xj6en+ZfJL1vnNLEUpS85tluh4 root@min-server (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:sIwnjEfSdu/Pqb0jQwVrigRwrJUtTizyGrqu3Fjgjqg root@min-server (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:LS1OyULLQ0ZywTGiap8KJOW2NzL61r0L4+C7+uWz888 root@min-server (ED25519)
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /lib/systemd/system/ssh.service.
rescue-ssh.target is a disabled or a static unit, not starting it.
ssh-import-id (5.10-0ubuntu1) 설정하는 중입니다 ...
Attempting to convert /etc/ssh/ssh_import_id
ncurses-term (6.2-0ubuntu2) 설정하는 중입니다 ...
Processing triggers for systemd (245.4-4ubuntu3.15) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for ufw (0.36-6ubuntu1) ...
내용 작성

 

SSH 실행 상태 확인 및  활성화 (sudo systemctl status ssh)

sudo systemctl status ssh

sudo systemctl enable ssh

sudo systemctl start ssh 

sudo systemctl restart ssh 

sudo systemctl stop ssh

 

$ sudo systemctl status ssh 
[sudo] min의 암호: 
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-03-19 11:26:10 KST; 22min ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 4744 (sshd)
      Tasks: 1 (limit: 13936)
     Memory: 1.0M
     CGroup: /system.slice/ssh.service
             └─4744 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups

 3월 19 11:26:10 min-server systemd[1]: Starting OpenBSD Secure Shell server...
 3월 19 11:26:10 min-server sshd[4744]: Server listening on 0.0.0.0 port 22.
 3월 19 11:26:10 min-server sshd[4744]: Server listening on :: port 22.
 3월 19 11:26:10 min-server systemd[1]: Started OpenBSD Secure Shell server.

SSH 서버가 중지 상태일때  모습니다. 

 

root@min-server:~# sudo systemctl stop ssh 
root@min-server:~# sudo systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Sat 2022-03-19 11:53:01 KST; 3s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 6437 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
    Process: 6438 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=0/SUCCESS)
   Main PID: 6438 (code=exited, status=0/SUCCESS)

 3월 19 11:52:33 min-server systemd[1]: Starting OpenBSD Secure Shell server...
 3월 19 11:52:33 min-server sshd[6438]: Server listening on 0.0.0.0 port 22.
 3월 19 11:52:33 min-server sshd[6438]: Server listening on :: port 22.
 3월 19 11:52:33 min-server systemd[1]: Started OpenBSD Secure Shell server.
 3월 19 11:53:01 min-server systemd[1]: Stopping OpenBSD Secure Shell server...
 3월 19 11:53:01 min-server sshd[6438]: Received signal 15; terminating.
 3월 19 11:53:01 min-server systemd[1]: ssh.service: Succeeded.
 3월 19 11:53:01 min-server systemd[1]: Stopped OpenBSD Secure Shell server.

 

방화벽 상태 확인 및 비 활성화(Firewall)

sudo ufw allow ssh

sudo ufw status

 

root@min-server:~# sudo ufw allow ssh
규칙이 업데이트됐습니다
규칙이 업데이트됐습니다(v6)
root@min-server:~# sudo ufw status
상태: 비활성
root@min-server:~# 

 

SSH 클라이언트 접속 

접속해볼 클라이언트 테스트 계정을 생성해 보겠습니다. 

저는 앞으로 Docker 를 공부해 볼 계획이라 docker-test 계정을 생성하겠습니다. 

테스트 절차는 아래 내용으로 진행 하겠습니다. 

 

1. 테스트 계정 생성 

2. 우분투 서버 IP 정보 확인 

3.리눅스 테스트 계정 접속 

4. 리모트 서버(윈도우 노트북 -> 우분투 테스트 계정 접속)

 

테스트 계정 생성 

# adduser docker-test
'docker-test' 사용자를 추가 중...
새 그룹 'docker-test' (1001) 추가 ...
새 사용자 'docker-test' (1001) 을(를) 그룹 'docker-test' (으)로 추가 ...
'/home/docker-test' 홈 디렉터리를 생성하는 중...
'/etc/skel'에서 파일들을 복사하는 중...
새  암호: 
새  암호 재입력: 
passwd: 암호를 성공적으로 업데이트했습니다
docker-test의 사용자의 정보를 바꿉니다
새로운 값을 넣거나, 기본값을 원하시면 엔터를 치세요
이름 []: 
방 번호 []: 
직장 전화번호 []: 
집 전화번호 []: 
기타 []: 
정보가 올바릅니까? [Y/n] 

 

우분투 서버 IP 정보 확인 

# ifconfig
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 180.64.82.103  netmask 255.255.255.192  broadcast 180.64.82.127
        inet6 fe80::8129:3259:2d4c:d494  prefixlen 64  scopeid 0x20<link>
        ether bc:5f:f4:38:74:e5  txqueuelen 1000  (Ethernet)
        RX packets 27950  bytes 27074047 (27.0 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17481  bytes 3314029 (3.3 MB)
        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 868  bytes 84762 (84.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 868  bytes 84762 (84.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

리눅스 테스트 계정 접속 

# ssh docker-test@180.64.82.103
The authenticity of host '180.64.82.103 (180.64.82.103)' can't be established.
ECDSA key fingerprint is SHA256:sIwnjEfSdu/Pqb0jQwVrigRwrJUtTizyGrqu3Fjgjqg.
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type 'yes', 'no' or the fingerprint: yes
Warning: Permanently added '180.64.82.103' (ECDSA) to the list of known hosts.
docker-test@180.64.82.103's password: 
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.13.0-35-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

22 updates can be applied immediately.
추가 업데이트를 확인하려면 apt list --upgradable 을 실행하세요.

Your Hardware Enablement Stack (HWE) is supported until April 2025.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

 

리모트 서버(윈도우 노트북 -> 우분투 테스트 계정 접속)

윈도우 노트북 SecureCRT 에서 우분투 접속을 하려고 하니 아래와 같은 에러가 발생합니다. 

Key exchange failed.
No compatible key exchange method. The server supports these methods: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256

/etc/ssh/sshd_config 를 수정 해서 문제를 해결하겠습니다. 

 

vi /etc/ssh/sshd_config

KexAlgorithms +diffie-hellman-group1-sha1
Ciphers +aes128-cbc

systemctl restart sshd

위 작업을 수행하니 이제 정상 접속이 되고 있네요 

 

728x90
반응형
728x90
반응형

우분투 버전 확인 기본 명령어 

lsb_release -a 명령어를 사용하면 현재 설치된 우분투 버전 정보가 확인 가능 합니다. 

 

 lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

현재 데스크탑에 설치된 우분투 버전은 Ubuntu 20.04.4 LTS 입니다.

 

기타 명령어 

cat /etc/issue

cat /etc/os-release

hostnamectl

 

 

min@min-server:~/바탕화면$ cat /etc/issue
Ubuntu 20.04.4 LTS \n \l


min@min-server:~/바탕화면$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

min@min-server:~/바탕화면$ hostnamectl
   Static hostname: min-server
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: e10702539e504a0fa045f0529579781f
           Boot ID: 85fa0694820a45b9af1cfe85be3ae16f
  Operating System: Ubuntu 20.04.4 LTS
            Kernel: Linux 5.13.0-35-generic
      Architecture: x86-64

728x90
반응형
728x90
반응형

자주사용하는 도커 명령어에 대해 정리해 보았습니다. 

 

Docker Volume 명령어

docker volume create test-volume 

docker volume ls

docker volume inspect test-volume

docker volume rm test-volume

 

docker volume 생성 

[oracle-docker@minsvr:/data1/oracle-docker/oradata]$ docker volume create test-volume
test-volume

 

docker volume list 확인 

[oracle-docker@minsvr:/data1/oracle-docker/oradata]$ docker volume ls
DRIVER    VOLUME NAME
local     compose_config_files
local     compose_db
local     compose_django
local     django-on-docker_media_volume
local     django-on-docker_postgres_data
local     django-on-docker_static_volume
local     oracle-docker_oradata
local     qms-on-docker_media_volume
local     qms-on-docker_postgres_data
local     qms-on-docker_static_volume
local     test-volume

 

docker volume 정보 확인 

[oracle-docker@minsvr:/data1/oracle-docker/oradata]$ docker volume inspect test-volume
[
    {
        "CreatedAt": "2022-03-18T19:29:25+09:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/data300G/docker-image/volumes/test-volume/_data",
        "Name": "test-volume",
        "Options": {},
        "Scope": "local"
    }
]

 

docker volume 삭제

[oracle-docker@minsvr:/data1/oracle-docker/oradata]$ docker volume rm test-volume
test-volume
[oracle-docker@minsvr:/data1/oracle-docker/oradata]$ docker volume ls
DRIVER    VOLUME NAME
local     compose_config_files
local     compose_db
local     compose_django
local     django-on-docker_media_volume
local     django-on-docker_postgres_data
local     django-on-docker_static_volume
local     oracle-docker_oradata
local     qms-on-docker_media_volume
local     qms-on-docker_postgres_data
local     qms-on-docker_static_volume

 

Docker 컨테이너 모두 중지 및 삭제

 docker stop $(docker ps -a -q)
 docker rm $(docker ps -a -q)

 

$ docker ps -a 
CONTAINER ID   IMAGE                       COMMAND                  CREATED        STATUS                    PORTS                                                                                  NAMES
9cffbff6ec74   oracle/database:19.3.0-ee   "/bin/sh -c 'exec $O   24 hours ago   Up 49 minutes (healthy)   0.0.0.0:1521->1521/tcp, :::1521->1521/tcp, 0.0.0.0:5500->5500/tcp, :::5500->5500/tcp   ora19c

$ docker ps -a -q
9cffbff6ec74

Docker Image 모두 삭제

docker rmi $(docker images -q)

Docker Image 리스트 확인

[oracle-docker@minsvr:/data1/oracle-docker]$ docker image ls 
REPOSITORY                           TAG                   IMAGE ID       CREATED          SIZE
192.168.17.83:5000/oracle/database   19.3.0-ee_v2          7a2299cca529   46 minutes ago   6.97GB
oracle/database                      19.3.0-ee             a5a30da1721d   3 weeks ago      6.54GB
oraclelinux                          7-slim                4133e87bc7fa   2 months ago     132MB
apache/ozone-runner                  20200625-1            f6874ac36a4c   21 months ago    1.07GB
tomcat                               8.5.46-jdk8-openjdk   8973f493aa0a   2 years ago      508MB
[oracle-docker@minsvr:/data1/oracle-docker]$ docker images -q
7a2299cca529
a5a30da1721d
4133e87bc7fa
f6874ac36a4c
8973f493aa0a
728x90
반응형

'02.Docker > Docker' 카테고리의 다른 글

[docker-compose] docker-compose 란?  (1) 2022.04.05
Docker 설치  (0) 2022.03.20
사용자 계정에서 Docker Command 사용 방법  (0) 2022.02.22
728x90
반응형

우분투 크롬 (Chrom) 설치

우부투(Ubuntu)설치시에 크롬은 기본 설치 되어 있지 않습니다.
기본 설치된 브라우저는 파이어 폭스가 설치 되어있습니다.
이번 포스팅에서는 Ubuntu 20.04.4 LTS 버전에서 크롬을 설치 하는 방법에 대해 알아 보겠습니다.
* 우분투 버전 정보 확인 방법
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

 

우분투 다운로드 (Ubuntu)

단축키(Ctrl+Alt+T) 또는 응용프로그램에서 터미널을  wget 명령을 이용해서 구글 크롬의 최신 .deb package 파일을다운로드 해야합니다.

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

Chrome Install (크롬 설치)

sudo apt install ./google-chrome-stable_current_amd64.deb

우분투 (Chrome) 크롬 실행

정상적으로 크롬이 설치 되었다면 우분투 프로그램 선택 하면 크롬 부라우저가 추가된것으로 확인 할수 있습니다.

이제부터 크롬 브라우져를 통해 웹 서칭을 할수 있겠네요 ^^

 

 

728x90
반응형
728x90
반응형

우분투에서는 기본적으로 윈도우 처럼 그림판 프로그램이 없어 캡쳐된 이미지를 편집 할 수 없습니다.

캡쳐된 이미지를 편집하기 위한 방법에 대해 이번 포스팅에서는 알아 보겠습니다.

우분투 이미지 캡쳐 방법

Ctrl +Shift + Print  단축 키로 그림을 캡쳐  할수 있고 Ctrl +v 로 캡쳐된 이미지를 붙여 넣기 할수 있습니다.

 

그림판 설치 (kolourpaint4)

sudo apt-get install kolourpaint4

그림판 팩키지 설치

그림판 실행 (kolourpaint4)

정상적으로 설치 되었다면 우분투 프로그램 매뉴 화면을 클릭해서 kolourpaint4 실행시켜서 캡쳐된 이미지를 편집 할수 있습니다.

실행화면

 

728x90
반응형

'06.OS > Linux' 카테고리의 다른 글

[Ubuntu] Vmware Ubuntu20.04 LTS 설치  (0) 2022.03.26
[Shell]trap 을 활용한 리눅스(Signal) 시그널 처리  (0) 2022.03.25
Ubuntu SSH 접속 방법  (0) 2022.03.20
Ubuntu 명령어  (0) 2022.03.19
우분투 Chrom(크롬)설치  (0) 2022.03.09
728x90
반응형

티스토리 글을 광고 글 없이 저장하는 방법

블러그 글을 쓰다 보면 작성된 글을 별도로 어떻게 저장할수 있을까에 대한 고민을 하게됩니다. 
브라우저에서 인쇄 버튼을 눌러서 PDF 문서로 저장 하게 되는데요 
이런 방법으로 글을 저장을 하면 불 필요한 광고 문구 까지 문서에 포함 되어 저장 되게 됩니다. 

이번 포스팅에 서는 이런 문제를 해결 하기 위한 방법을 소개하겠습니다. 

 

1.네이버 웨일 에서 PDF 저장 

네이버 웨일이나 구글 크롬 브라우저 에서  우측 상단에 인쇄버튼을 눌러서 PDF 로 글을 저장 할수 있습니다. 

하지만 이 방법을 사용하게 되면 블로그에 원치 않은 머릿글이나 광고글 댓글들이 포함되어 파일로 저장 되게 됩니다. 

확장 프로그램을 통한 PDF 문서 저장 (클린 모드)

웨일 스토어에서 클린모드 앱을 설치 합니다. 

웨일 확장앱 설치

웨일 스토어에서 클린 모드 검색후 확장앱 설치 후 PDF 인쇄 

클린 모드 확장앱 설치&amp;nbsp;

2.크롬 웹스토어  Print Friendly & PDF 확장 프로 그램 설치 

크롬 웹스토어 확장 프로그램 설치(Print Friendly &amp;amp; PDF)

 

마우스 우클릭 후 Print Friendly & PDF 를 클릭 후  문서 저장 

문서 중 삭제하고자 하는 문구가 있다면 마우스 오버시 휴지통 버튼을 클릭하면 내용을 삭제 할수 있습니다. 

하지만 원본 블로그 양식과 차이가 있습니다. 

블로그에서 스킨을 별도로 꾸몄다면 내가 작상한 스킨이 원본 글과 다르게 적용되어 출력 되게됩니다. 

조금 아쉽네요.. 

 

블로그 글  Print Friendly & PDF 적용

 

3.크롬 웹스토어 Print Edit WE 확장 프로 그램 설치 (추천) 

크롬 웹스토어에서 (https://chrome.google.com/webstore) Print Edit WE 검색후 확장 플러그인을 설치 합니다. 

Print Edit WE 플러그인이 정상 설치 되었다면 PDF 로 저장하고 싶은 블로그 글을 플러그인 창에서 클릭해서 실행 하면 됩니다.

해당 플로그인을 통해 PDF 로 저장 하고 싶은 글을 수정하고나 삭제 할수 있습니다. 

선택창 누른후 Delete 버튼 클릭하면 광고글을 삭제 할수 있고 , Undo 버튼을 누른면 이전 상태로 되될릴수 있습니다. 

 

위에서 설명 했던 다른 방법(웨일, 클린모드) 보다 Print Edit WE를 사용해서 PDF 문서를 편집해서 저장 하니 깔끔하네요 ... 강력 추천합니다. 

 

 

 

사용방법 

728x90
반응형
728x90
반응형

 

1.Docker Image 다운로드 

우선 Docker 환경에서 오라클을 설치 하려면 오라클 이미지가 준비 되어있어야 겠죠? 

아래 GitHub 에서 Oracle19c 이미지를 다운로드 받습니다. 

https://github.com/oracle/

git clone https://github.com/oracle/docker-images.git

 

 

 

2.Oracle19c 바이너리 다운로드 

Docker 이미지를 다운로드를 받았다면 이제 실제로 설치할 오라클 바이너리를 준비해야 겠습니다. 

아래 경로에서 오라클 19c 바이너리(LINUX.ZSERIES64_193000_db_home.zip)를 다운로드 받습니다. 

 

https://www.oracle.com/kr/database/technologies/oracle19c-linux-downloads.html

 

 

3. 설치 

설치를 위한 바이너리가 모두 준비되었습니다. 

-rw-r--r--  1 oracle-docker oracle-docker 3059705302  2월 22 19:36 LINUX.X64_193000_db_home.zip
drwxr-xr-x 32 oracle-docker oracle-docker       4096  2월 22 15:40 docker-images

 

이제 본격적인 설치 작업을 진행하도록 하겠습니다. 

 

Oracle 19c 바이너리 Docker 디렉토리 복사 

 cp LINUX.X64_193000_db_home.zip docker-images/OracleDatabase/SingleInstance/dockerfiles/19.3.0

 

Docker Image build

cd docker-images/OracleDatabase/SingleInstance/dockerfiles
./buildContainerImage.sh -e -v 19.3.0

 

Step 22/22 : CMD exec $ORACLE_BASE/$RUN_FILE
 ---> Running in 4bfe6a27a076
Removing intermediate container 4bfe6a27a076
 ---> a5a30da1721d
Successfully built a5a30da1721d
Successfully tagged oracle/database:19.3.0-ee


  Oracle Database container image for 'ee' version 19.3.0 is ready to be extended: 
    
    --> oracle/database:19.3.0-ee

  Build completed in 1146 seconds.

 

Docker 실행 

$ docker run --name oracle -p 1521:1521 -p 5500:5500 -e ORACLE_PWD=oracle -v oracle19c:/opt/oracle/
oradata oracle/database:19.3.0-ee

 

$ docker run --name oracle -p 1521:1521 -p 5500:5500 -e ORACLE_PWD=oracle -v oracle19c:/opt/oracle/
oradata oracle/database:19.3.0-ee
ORACLE EDITION: ENTERPRISE

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 23-FEB-2022 04:49:38

Copyright (c) 1991, 2019, Oracle.  All rights reserved.

Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/4235c03b5d12/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                23-FEB-2022 04:49:38
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/4235c03b5d12/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
중략.......................
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 23 05:05:33 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> 
System altered.

SQL> 
System altered.

SQL> 
Pluggable database altered.

SQL> 
PL/SQL procedure successfully completed.

SQL> SQL> 
Session altered.

SQL> 
User created.

SQL> 
Grant succeeded.

SQL> 
Grant succeeded.

SQL> 
Grant succeeded.

SQL> 
User altered.

SQL> SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
The Oracle base remains unchanged with value /opt/oracle
The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
ORCLPDB1(3):ALTER DATABASE DEFAULT TABLESPACE "USERS"
ORCLPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"
2022-02-23T05:05:33.298695+00:00
ALTER SYSTEM SET control_files='/opt/oracle/oradata/ORCLCDB/control01.ctl' SCOPE=SPFILE;
2022-02-23T05:05:33.303320+00:00
ALTER SYSTEM SET local_listener='' SCOPE=BOTH;
   ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE
Completed:    ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE

XDB initialized.

 

Oracle 접속 및 테스트 

$ docker exec -it oracle sqlplus sys/oracle@//localhost:1521/ORCLCDB as sysdba

 

$ docker exec -it oracle sqlplus sys/oracle@//localhost:1521/ORCLCDB as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 23 08:04:55 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select * from dual;

D
-
X

SQL> create table TEST(id number, name varchar(100));

Table created.

SQL> insert into TEST values(1,'test');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from TEST;

        ID
----------
NAME
--------------------------------------------------------------------------------
         1
test


SQL> 
728x90
반응형
728x90
반응형

일반 계정에서 Docker 실행시 에러 발생 하는 문제 

사용자 계정에서 DOCKER 명령을 수행시에 권한 에러 발생을 합니다. 

일반 사용자 계정에서 Docker 명령을 수행할수 있도록 권한을 변경하는 방법에 대해 알아 보겠습니다. 

$ docker-compose -f docker-compose.test.yml up --build
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1277, in request
  File "http/client.py", line 1323, in _send_request
  File "http/client.py", line 1272, in endheaders
  File "http/client.py", line 1032, in _send_output
  File "http/client.py", line 972, in send
  File "docker/transport/unixconn.py", line 43, in connect
PermissionError: [Errno 13] Permission denied

 

해결 방법 

1.sudoers 파일 사용자 계정 추가

visudo -f /etc/sudoers

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
docker_test ALL=(ALL) ALL

 

2.사용자 계정에 docker 그룹 추가

 

sudo usermod -aG docker $USER 

로컬 시스템 관리자에게 일반적인 지침을 받았으리라 믿습니다.
보통 세가지로 요약합니다:

    #1) 타인의 사생활을 존중하십시오.
    #2) 입력하기 전에 한 번 더 생각하십시오.
    #3) 막강한 힘에는 상당한 책임이 뒤따릅니다.

[sudo] docker_test의 암호:

3.일반 사용자 계정 재 접속 후 Docker(Docker-Compose) 명령 실행 

[docker_test@minsvr:/data1/docker_test]$ exit
logout
[root@minsvr:/root]$ su - docker_test
마지막 로그인: 토  9월 18 16:15:02 KST 2021 일시 pts/20
[docker_test@minsvr:/data1/docker_test]$ cd compose/
[docker_test@minsvr:/data1/docker_test/compose]$ ll
합계 16
drwxr-xr-x. 3 docker_test docker_test 4096  9월 18 15:59 .
drwx------. 6 docker_test docker_test 4096  9월 18 15:59 ..
drwxr-xr-x. 2 docker_test docker_test 4096  9월 18 15:58 app
-rw-r--r--. 1 docker_test docker_test   95  9월 18 15:59 docker-compose.test.yml
[docker_test@minsvr:/data1/docker_test/compose]$ docker-compose -f docker-compose.test.yml up --build

Building db
Sending build context to Docker daemon   2.56kB
Step 1/11 : FROM openjdk:8
 ---> 08121337b7a4
Step 2/11 : MAINTAINER mjk <jungki_min@tmax.co.kr>
 ---> Using cache
 ---> a85abd8125dd
Step 3/11 : RUN apt-get update &&     apt-get install -y     libstdc++6 libaio1 libncurses5 vim expect nmap netcat     && apt-get clean
 ---> Using cache
 ---> cd3f5538bdfd
Step 4/11 : ENV APP_HOME=/home/app
 ---> Running in 71fc6363b5f2
Removing intermediate container 71fc6363b5f2
 ---> 41a120bc13f2
728x90
반응형

'02.Docker > Docker' 카테고리의 다른 글

[docker-compose] docker-compose 란?  (1) 2022.04.05
Docker 설치  (0) 2022.03.20
자주 사용하는 Docker 명령어  (0) 2022.03.18

+ Recent posts