23 Dec, 2022 - About 4 minutes
Artifactory Setup
Intro
In this article i will describe how to setup a docker environment to have a JFrog Artifactory local solution.
Objective
The main objective of this walkthrough is to have a local repository to manage packages such as Nugets, jars, rpms, etc.
Could be useful to test CI/CD pipelines also.
Versions
Artifactory has several versions. It is recommend to use a Professional edition for productivity workloads. For this article we consider the OSS version
Requirements
For this setup one should have:
- docker
- docker-compose
Installation
Obtain the docker-compose image
https://releases.jfrog.io/artifactory/bintray-artifactory/org/artifactory/oss/docker/jfrog-artifactory-oss/7.12.10/jfrog-artifactory-oss-7.12.10-compose.tar.gz |
NOTE: Check the latest version on the official website.
Extract the tarball
Run the config.sh
with privileges to setup your folder with the proper permissions.
In my case i also installed the PostgreSQL service.
One should have an output similar to this one
Beginning JFrog Artifactory setup |
At the end of the process the postgres container is still up. I would suggest killing it as we are going to setup the docker-compose setup for it.
# docker ps |
Killing the containers
docker kill 77bbf3150642 |
NOTE: Attention don’t run the prune command if you want to keep other containers running.
Post Install
During the setup I’ve selected the following path
/home/rramos/Development/github/dockers/docker-artifactory/data |
However there are some adjustments required for the services to reach the containers which will be on the same network and need to be adjusted.
Following this setup you should now have on your current dir data
and artifactory-oss-7.12.10
folder.
Create the following file template docker file that starts all the components
cp artifactory-oss-7.12.10/templates/docker-compose-all.yaml docker-compose.yaml |
And replace the line
POSTGRES_PASSWORD=${PG_PASS} |
Let’s include that var on the env file.
cp artifactory-oss-7.12.10/.env . |
Add the password you defined for postgres on .env
file.
PG_PASS=V3ry$$scurePasssW0rd |
Let’s spin up the application
docker-compose up -d |
If you start getting some issues regarding DB connection issues there is a final step.
Stop all the containers
docker-compose down |
Edit the file ./data/var/data/nginx/conf.d/artifactory.conf
and replace localhost
references with artifactory
NOTE: You may need sudo permission to change those files
Also edit the file ./data/var/etc/system.yaml
Making sure the DB url
is like:
url: jdbc:postgresql://postgres:5432/artifactory |
Now let’s restart the containers
docker-compose up -d |
And access on the following url: http://localhost:8081/artifactory/
The default user/password is admin
/password
Now it’s time to explore …
Conclusion
There are several ways to setup Artictory depending on your environment. If you want to use for local developments it may not payoff due to the limitation of the oss version. One cannot manage Nuget packages for instance and require an pro version. As that was may principal objective i didn’t explore more the tool.
Also include the docker-compose setting on my dockers repo