Tech Note
도커를 활용한 서비스 배포하기 (rpm 설치) #1
Dominic-Kim
2022. 6. 8. 13:07
728x90
현재 패치 및 가용성 문제를 해결하기 위해 docker를 설치해야 하는 서버는
- dmz망과 같이 특정 대역에서의 접속만 허용이 되어있는 상태
- yum install 불가
직접 rpm 파일을 받아서 패치하기로 결정
먼저 아래 링크를 통해 3가지 파일을 다운 받는다.
https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
Index of linux/centos/7/x86_64/stable/Packages/
download.docker.com
ce, ce-cli, container.io 를 다운로드 받으면 된다.
그리고 아래와 같이 입력한다.
yum install -y ce.rpm
내 서버의 경우 의존성 문제가 발생한다.
container.io >> ce-cli >> ce 순서로 설치하라고 하지만 여전히 의존성 문제가 발생
... (중략) ...
.17-3.el7.x86_64
--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-20.10.17-3.el7 .x86_64
--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-20 .10.17-3.el7.x86_64
---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be installed
---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be installed
--> Finished Dependency Resolution
Error: Package: 3:docker-ce-20.10.17-3.el7.x86_64 (/docker-ce-20.10.17-3.el7.x86 _64)
Requires: docker-ce-cli
Error: Package: 3:docker-ce-20.10.17-3.el7.x86_64 (/docker-ce-20.10.17-3.el7.x86 _64)
Requires: containerd.io >= 1.4.1
Error: Package: 3:docker-ce-20.10.17-3.el7.x86_64 (/docker-ce-20.10.17-3.el7.x86 _64)
Requires: docker-ce-rootless-extras
You could try using --skip-broken to work around the problem
필요한 것만 설치하면 된다고 판단되서 의존성 문제는 무시하기 위해 rpm 명령어로 설치 진행
rpm -Uvh *.rpm --nodeps # nodeps 옵션은 의존성 에러를 무시 할 수 있다.
[root@localhost docker]# rpm -Uvh docker-ce-cli-20.10.17-3.el7.x86_64.rpm --nodeps
경고: docker-ce-cli-20.10.17-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
준비 중... ################################# [100%]
Updating / installing...
1:docker-ce-cli-1:20.10.17-3.el7 ################################# [100%]
[root@localhost docker]# rpm -Uvh docker-ce-20.10.17-3.el7.x86_64.rpm --nodeps
경고: docker-ce-20.10.17-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
준비 중... ################################# [100%]
Updating / installing...
1:docker-ce-3:20.10.17-3.el7 ################################# [100%]
[root@localhost docker]# rpm -Uvh docker-scan-plugin-0.17.0-3.el7.x86_64.rpm --nodeps
경고: docker-scan-plugin-0.17.0-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
준비 중... ################################# [100%]
Updating / installing...
1:docker-scan-plugin-0:0.17.0-3.el7################################# [100%]
설치완료. 정상설치 여부를 확인한다. 성공.
[root@localhost docker]# systemctl start docker # Docker 서비스 실행
[root@localhost docker]# docker run hello-world # Docker Image 생성
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:80f31da1ac7b312ba29d65080fddf797dd76acfb870e677f390d5acba9741b17
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/
폐쇄망이라 pull하는 시점에서 실패하겠지만, 이미지를 생성해서 들어갈 예정이라 문제는 없을 것으로 보인다.