이 문서는 Docker Compose를 이용하여 Artifactory를 설치하는 일반적인 방법을 공유하기 위해 작성되었습니다.
설치환경
Docker Compose : v2.27.0
Artifactory : artifactory-oss-7.90.5
PostgreSQL : 13
Docker Compose 요구사항
Docker Compose를 사용하여 Artifactory를 설치할 때 Docker Compose v1.24 이상이 실행하려는 머신에 설치되어 있어야 합니다.
설치 파일 다운로드 및 압축 해제
아래 링크에 접속하여 녹색 화살표를 클릭해 Docker Compose를 다운로드합니다.
다운로드한 아카이브(.tar.gz 파일)의 압축을 해제한 후, 압축이 풀린 폴더로 이동합니다.
tar -xvf jfrog-artifactory-pro-7.90.5-compose.tar.gz cd artifactory-pro-7.90.5
‘.env’ 파일은 Docker Compose가 사용하는 환경 변수 파일로, 설치 및 업그레이드 중에 업데이트 됩니다.
이 파일을 수정할 때는 주의가 필요하며, 업그레이드 전에 백업을 하는 것이 좋습니다. (이 파일은 기본적으로 숨겨져 있을 수 있습니다.)
Artifactory 구성 스크립트 실행
이 스크립트는 시스템의 구성 파일을 설정하고, 필요한 디렉토리와 권한을 설정하는 등의 작업을 자동으로 수행합니다.
( Artifactory에는 기본으로 내장된 Derby 데이터베이스가 제공됩니다.
그러나 운영 환경에서는 외부 PostgreSQL 데이터베이스를 사용할 것을 권장합니다. )
bash ./config.sh
#설치 디렉토리 설정 (기본: /root/.jfrog/artifactory) Installation Directory (Default: /root/.jfrog/artifactory): #현재 머신의 IP 입력 Please specify the IP address of this machine (Default: ::1): localhost #추가 노드 설치 여부 Are you adding an additional node to an existing product cluster? [y/N]: n #PostgreSQL 설치 여부 (외부 PostgreSQL 사용 시 n) Do you want to install PostgreSQL? [Y/n]: n #외부 DB 정보 입력 Enter database type, supported values [ postgresql mssql mariadb mysql oracle derby ]: postgresql Provide the database connection details PostgreSQL url. Example: [jdbc:postgresql://<IP_ADDRESS>:<PORT>/artifactory]: jdbc:postgresql://localhost:5432/artifactory Database username (If your existing connection URL already includes the username, leave this empty): artifactory Database password (If your existing connection URL already includes the password, leave this empty): Database connection successful Creating third party directories (if necessary) Docker setup complete ``` Done
위에서 입력한 값은 system.yaml 파일에서 확인할 수 있습니다.
/$JFROG_HOME/artifactory/var/etc/system.yaml (ex. /root/.jfrog/artifactory/var/etc/system.yaml)
템플릿 파일을 복사하여 필요한 구성을 커스터마이징할 수도 있습니다. (system.basic-template.yaml, system.full-template.yaml)
호스트 ID, IP 설정 확인
shared.node.id (호스트ID) : 노드나 인스턴스를 식별하는 고유한 ID입니다.
shared.node.ip (호스트IP) : 노드의 IP 주소로, 외부에서 해당 노드에 접근할 때 사용됩니다.
이 두 값이 system.yaml에 제대로 설정되어야 Docker 컨테이너가 다른 노드 및 서비스와 정상적으로 통신할 수 있습니다. 수동으로 설정하지 않으면, 컨테이너의 IP 주소가 자동으로 할당되어 외부 연결이 어려워질 수 있습니다.
/$JFROG_HOME/artifactory/var/etc/system.yaml (ex. /root/.jfrog/artifactory/var/etc/system.yaml)
shared: node: id: test01 ip: 192.168.0.1
OSS 버전 설치 방법
OSS 버전을 설치하려면, 먼저 config.sh를 실행한 후 생성된 docker-compose.yaml 파일에서 이미지 이름을 수정하여 설치할 수 있습니다.
version: '3' services: artifactory: image: ${DOCKER_REGISTRY}/jfrog/artifactory-oss:${ARTIFACTORY_VERSION}
Artifactory 관리
Docker 기본 명령을 사용하여 Artifactory를 관리합니다.
# 서비스를 시작하기 전에 PostgreSQL을 시작해야 합니다. docker compose -p rt up -d docker compose -p rt ps docker compose -p rt down
Artifactory 로그 확인
다음 명령을 사용하여 Artifactory 로그를 확인합니다.
docker compose -p rt logs
Artifactory 설정
Artifactory를 설정하기 위해 http://localhost:8082/ui/ 으로 접속합니다.
초기 계정 정보는 다음과 같습니다.
ID : admin
PW : password