Docker란
도커(Docker)는 OS에 앱을 패키징하여 배포할 수 있도록 해 주는 프로그램입니다.
가상머신 및 가상OS 설치 없이 프로그램 가동이 가능 합니다.
1.OS확인
- Ubuntu Lunar 23.04
- Ubuntu Kinetic 22.10
- Ubuntu Jammy 22.04 (LTS)
- Ubuntu Focal 20.04 (LTS)
- Ubuntu Bionic 18.04 (LTS)
2.Set up the repository
1 2 3 4 |
sudo apt-get update sudo apt-get install ca-certificates curl gnupg |
1 2 3 4 5 |
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 |
1 2 3 4 5 6 |
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 |
3.Install Docker Engine
1 2 3 4 |
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin |
4.설치확인
1 2 3 4 |
sudo service docker start sudo docker run hello-world |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
~$ sudo docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 70f5ac315c5a: Pull complete Digest: sha256:fc6cf906cbfa013e80938cdf0bb199fbdbb86d6e3e013783e5a766f50f5dbce0 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. (arm64v8) 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/ |
5.Uninstall Docker Engine
1 2 3 4 5 |
sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras sudo rm -rf /var/lib/docker sudo rm -rf /var/lib/containerd |
1 2 3 4 5 6 7 |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update apt-cache policy docker-ce sudo apt-get install -y docker-ce |
1 2 3 |
sudo docker run hello-world |
Oracle 11g 설치 해보기
1.검색
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
sudo docker search oracle-xe-11g NAME DESCRIPTION STARS OFFICIAL AUTOMATED oracleinanutshell/oracle-xe-11g 273 wnameless/oracle-xe-11g-r2 Oracle Express Edition 11g Release 2 on Ubun… 96 christophesurmont/oracle-xe-11g Clone of the wnameless/oracle-xe-11g. 7 thebookpeople/oracle-xe-11g 5 webdizz/oracle-xe-11g-sa This is a simple image based on sath89/oracl… 1 [OK] acktsw/oracle-xe-11g fork from https://hub.docker.com/r/sath89/or… 3 [OK] jaspeen/oracle-xe-11g Fork from sath89/docker-oracle-xe-11g - smal… 6 [OK] orangehrm/oracle-xe-11g docker container with Oracle Express Editio… 17 [OK] loads/oracle-xe-11g-r2 0 andyrbell/oracle-xe-11g-centos Oracle Express Edition 11g Release 2 on Cent… 0 larmic/oracle-xe-11g Using wnameless/oracle-xe-11g with created u… 0 jark/oracle-xe-11g-r2-cdc 0 dotcms/oracle-xe-11g 0 ukhomeofficedigital/oracle-xe-11g Oracle Database Express Edition 11g Container 4 [OK] zeroturnaround/oracle-xe-11g 0 nritholtz/oracle-xe-11g nritholtz/oracle-xe-11g 0 activeeon/oracle-xe-11g 0 gaesi/oracle-xe-11g Based on: oracleinanutshell/oracle-xe-11g 0 wscherphof/oracle-xe-11g-r2 Oracle® Database Express Edition 11g Release… 3 toneloc01/oracle-xe-11g Out-of-the-box oralce xe image from ubuntu 1… 0 switchsoftware/oracle-xe-11g 0 yuxialuo/oracle-xe-11g-r2-cdc-demo 0 aerisconsulting/oracle-xe-11g Oracle Express 11g R2 on Ubuntu 16.04 LTS (b… 0 paliari/oracle-xe-11g 0 avuletica/oracle-xe-11g-r2 Dockerfile of Oracle Database Express Editio… 0 |
2.pull
1 2 3 |
sudo docker pull jaspeen/oracle-xe-11g |
3. 실행
1 2 3 |
sudo docker run --name oracle -d -p 1521:1521 jaspeen/oracle-xe-11g |
4.sqlplus 실행
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
sudo docker exec -it oracle sqlplus SQL*Plus: Release 11.2.0.2.0 Production on Fri Feb 25 12:44:34 2022 Copyright (c) 1982, 2011, Oracle. All rights reserved. Enter user-name: system Enter password: password Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production SQL> |
모든 docker 확인 및 중지
1 2 3 4 |
sudo docker ps -a sudo docker stop $(docker ps -a -q) |