Table of Contents
Installing Artifactory on Docker
In this tutorial, we will
- Get Artifactory Docker Image from Docker Hub
- Run the Docker Image
- Verify Installation
Get official Artifactory Image
Pull the Artifactory OSS Docker Image, it’s an open source image. For this tutorial, we will go ahead with Artifactory OSS
docker pull docker.bintray.io/jfrog/artifactory-oss:latest
Run Docker Image
Map localhost ports
- Then we will try to run the image, we will map Docker on localhost port 8081
docker run --name artifactory -d -p 8081:8081 docker.bintray.io/jfrog/artifactory-pro:latest
Map Volumes to persist data
It is important to persist the artifacts which will be fed to Artifactory, so we have two options here
- If it is important to persist the Jenkins data you can choose between the 2 options.
- Save data within the docker container, the docker volume persists upon restarts and even after if the container is deleted.
- Save data on your host/disk/laptop/machine. Weigh in your requirements and see what fits in with your requirements.
If artifactory was running using above command already then you need to stop the container using
docker stop artifactory
docker rm artifactory
- Option-1> To persist the data within docker container12345docker volume create --name artifactory5_datadocker run --name artifactory-5.0.0 -d -v artifactory5_data:/var/opt/jfrog/artifactory -p 8081:8081 docker.bintray.io/jfrog/artifactory-pro:latest
- Option-2> To persist the data within host( host machine/laptop) container123docker run --name artifactory-5.0.0 -d -v /Users/abhishek/jfrog/artifactory:/var/opt/jfrog/artifactory -p 8081:8081 docker.bintray.io/jfrog/artifactory-oss:latest
- Since Artifactory was mapped to localhost port 8081, open your browser and use localhost:8081 if accessing from the same machine.