What is it?
Artifactory is a universal repository manager that integrates with your existing system.
Map Of Content
- What can you store?
- Docker | Maven | Node Modules
- Setup
- Setting up Artifactory with Docker Compose - setup a local environment with Docker Compose
- Nginx config - Configure nginx for Artifactory
- Fixing hosts - Fix your hosts on Windows
- Configuration
- Artifactory repository setup - Configure Artifactory with the needed repositories and setup the permissions
- Usage
- Deploying artifacts - How to deploy artifacts to your local instance
- Troubleshooting - Troubleshooting steps
Setting up Artifactory with Docker Compose
version: '3.6'
services:
# NGINX reverse proxy server
nginx:
image: nginx
container_name: nginx
restart: always
ports:
- 80:80
- 443:443
volumes:
- "./nginx/conf.d:/etc/nginx/conf.d"
- "./nginx/log:/var/log/nginx"
server:
image: gitea/gitea:1.16.0
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
restart: always
volumes:
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "222:22"
artifactory:
image: docker.bintray.io/jfrog/artifactory-oss:6.15.1
user: "${UID}:${GID}"
ports:
- 8081:8081
- 8082:8082
volumes:
- ./artifactory:/var/opt/jfrog/artifactory
environment:
- EXTRA_JAVA_OPTIONS=-Xmx4g
restart: always
ulimits:
nproc: 65535
nofile:
soft: 32000
hard: 40000Nginx config:
upstream artifactory_app {
server artifactory:8081;
}
server {
listen 80;
server_name artifactory.corp.local;
client_max_body_size 0;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://artifactory_app;
}
}Fixing hosts
Add these to your hosts:
# vRA IaaC START SECTION
127.0.0.1 artifactory.corp.local
# vRA IaaC END SECTIONArtifactory repository setup
- Go to http://artifactory.corp.local
- Follow initial steps and setup users
- Add a new local maven repository called
pscoe - Add a new remote maven repository called
mavenand urlhttps://repo1.maven.org/maven2 - Add a new remote maven repository called
apacheand urlhttps://repository.apache.org/content/repositories/releases/ - Add a new virtual repo called
virtualwith all of the other 3 repos - You will have to go to groups and setup a group add your user to that group.
- Go to permissions and either create a new permission that gives the newly created group permission to Manage Repositories.
Deploying artifacts
- Make sure your
settings.xmlis correct - Run
jfrog config add - Setup the connection
jfrog rt u --recursive=true --flat=false ./ virtual( run this if you actually have artifacts which initially probably you won’t )
Troubleshooting
- Read this. jFrog latest versions have an issue with the way the /artifactory is delivered ( now it’s delivered with a nice and fancy html which is not what we want ). This is solved by adding
arifactory.redirect.native.browser.requests.to.ui=falseinartifactory.system.properties. To get into the container run:docker-compose exec artifactory bashfind the file:find / -name artifactory.system.propertiesand modify this file manually ( after which restart the containerdocker-compose restart artifactory) - jCenter used to be de-facto way of retrieving maven artifacts. jCenter is now deprecated and while the official maven repository has A LOT of artifacts, chances are it is missing just as many. One of these for example is ant version 1.8.1 as maven repo has up to 1.7.0 only. You can sort of solve this by searching for a repository that has that version. This applies to other packages.