Are you looking to streamline your software development and deployment processes? JFrog Artifactory Open Source Software (OSS) is a powerful universal artifact repository that can significantly enhance your workflow. This guide will walk you through the process of installing JFrog Artifactory OSS using Docker, making it simple and efficient to set up on your system.

Step 1: Pull the JFrog Artifactory OSS Docker Image

The first step is to download the necessary Docker image for JFrog Artifactory OSS. Open your terminal or command prompt and execute the following command:

docker pull docker.bintray.io/jfrog/artifactory-oss:latest

This command fetches the latest version of the Artifactory OSS image from Docker Hub.

Step 2: Prepare Your Local Storage Directory

To ensure persistent storage for your Artifactory data, it’s crucial to create a dedicated directory on your host machine. For Windows 11 Pro users, we recommend creating a folder at:

c:/apps/jfrog/artifactory

When working with Windows Subsystem for Linux 2 (WSL2) and Ubuntu, this path will be accessible as /mnt/c/apps/jfrog/artifactory. This directory will be mapped to the Artifactory container’s data volume.

Step 3: Launch Your JFrog Artifactory Container

With the Docker image pulled and your storage directory ready, you can now start the JFrog Artifactory container. Use the following docker run command:

docker run --name artifactory -d \
  -p 8081:8081 \
  -p 8082:8082 \
  -v /mnt/c/apps/jfrog/artifactory:/var/opt/jfrog/artifactory \
  docker.bintray.io/jfrog/artifactory-cpp-ce

Let’s break down this command:
* --name artifactory: Assigns a readable name ‘artifactory’ to your container.
* -d: Runs the container in detached mode (in the background).
* -p 8081:8081: Maps port 8081 on your host to port 8081 in the container (Artifactory UI).
* -p 8082:8082: Maps port 8082 on your host to port 8082 in the container (Artifactory’s service port).
* -v /mnt/c/apps/jfrog/artifactory:/var/opt/jfrog/artifactory: Mounts your host directory to the /var/opt/jfrog/artifactory directory inside the container, ensuring all Artifactory data is stored persistently outside the container.
* docker.bintray.io/jfrog/artifactory-cpp-ce: Specifies the Docker image to use.

Advanced Configuration: Customizing Java Options

For more advanced setups or to fine-tune Artifactory’s performance, you can pass Java system properties to the JVM running Artifactory using the EXTRA_JAVA_OPTIONS environment variable. This allows you to allocate more memory, adjust garbage collection settings, and more. Refer to the official Docker setup documentation for comprehensive details.

Here’s an example demonstrating how to configure JVM options, typically used with the Pro version, but illustrating the concept:

docker run --name artifactory -d \
  -p 8081:8081 \
  -p 8082:8082 \
  -v /jfrog/artifactory:/var/opt/jfrog/artifactory \
  -e EXTRA_JAVA_OPTIONS='-Xms512m -Xmx2g -Xss256k -XX:+UseG1GC' \
  docker.bintray.io/jfrog/artifactory-pro:latest

In this example:
* -e EXTRA_JAVA_OPTIONS='-Xms512m -Xmx2g -Xss256k -XX:+UseG1GC': Sets initial heap size to 512MB, maximum heap size to 2GB, thread stack size to 256KB, and enables G1 Garbage Collector.

Conclusion

You’ve successfully installed JFrog Artifactory OSS using Docker! This setup provides a robust and easily manageable artifact repository for your development needs. You can now access your Artifactory instance via your web browser, typically at `http://localhost:8081`, and begin integrating it into your CI/CD pipelines. Enjoy a more organized and efficient artifact management experience!

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed