Docker

[Docker] oracle 이미지 가져올 때, unauthorized: Auth failed

IT-PAPA 2024. 5. 30. 06:55
728x90
반응형

아래와 같이 oracle 21.3.0.0 에 대한 docker 이미지 생성 실행 시 오류가 발생하여, docker login 해도 안될 때가 있다.

version: '3.9'
services:
  database:
    image: 'container-registry.oracle.com/database/enterprise:21.3.0.0'
    restart: always
    volumes:
      - './oradata:/opt/oracle/oradata'
    environment:
      - ENABLE_ARCHIVELOG=true
      #- ORACLE_CHARACTERSET=UTF-8
      #- ORACLE_EDITION=<your_database_edition> # enterprise/standard, default: enterprise
      - INIT_PGA_SIZE=3000 #<your_database_PGA_memory_MB>
      - INIT_SGA_SIZE=1000 #<your_database_SGA_memory_MB>
      - ORACLE_PWD=admin
      #- ORACLE_PDB=orcl
      - ORACLE_SID=orcl
    ports:
      - '5500:5500'
      - '1525:1521'
    container_name: 'oracle21'

#Parameters:
# --name:                 The name of the container (default: auto generated
# -p:                     The port mapping of the host port to the container port.
#                         Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express)
# -e ORACLE_SID:          The Oracle Database SID that should be used (default:ORCLCDB)
# -e ORACLE_PDB:          The Oracle Database PDB name that should be used (default: ORCLPDB1)
# -e ORACLE_PWD:          The Oracle Database SYS, SYSTEM and PDBADMIN password (default: auto generated)
# -e INIT_SGA_SIZE:       The total memory in MB that should be used for all SGA components (optional)
# -e INIT_PGA_SIZE:       The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (optional)
# -e ORACLE_EDITION:      The Oracle Database Edition (enterprise/standard, default: enterprise)
# -e ORACLE_CHARACTERSET: The character set to use when creating the database (default: AL32UTF8)
# -e ENABLE_ARCHIVELOG:   To enable archive log mode when creating the database (default: false). Supported 19.3 onwards.
# -v /opt/oracle/oradata
#                         The data volume to use for the database. Has to be writable by the Unix "oracle" (uid: 54321) user inside the container
#                         If omitted the database will not be persisted over container recreation.
# -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup
#                         Optional: A volume with custom scripts to be run after database startup.
#                         For further details see the "Running scripts after setup and on
#                         startup" section below.
# -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup
#                         Optional: A volume with custom scripts to be run after database setup.
#                         For further details see the "Running scripts after setup and on startup" section below.

 

docker compose up -d 실행 시 인증 오류 발생

root@dev-oracle:~/oracle# docker compose up -d
[+] Running 1/1
 ✘ database Error Head "https://container-registry.oracle.com/v2/database/enterprise/manifests/21.3.0.0": unauthorized: Auth failed.                                           0.3s 
Error response from daemon: Head "https://container-registry.oracle.com/v2/database/enterprise/manifests/21.3.0.0": unauthorized: Auth failed.

 

해결 방법

docker login 시 oralce 에 로그인하면 정상적으로 이미지를 가져올 수 있다.

단, container-registry.oracle.com 에 가입된 유저만 가능하다.

docker login container-registry.oracle.com

docker 이미지 가져오기 성공 후 컨테이너
docker 이미지 가져오기 성공 후 컨테이너

 

728x90
반응형
LIST