Getting Started with JFrog Artifactory
I struggle a little bit to find information that needs a beginner to start with JFrog. I wanted to share the steps that I discover. In this story, I will share a few steps that can help you to get started with JFrog in no time.
→ Sign up for a Free Trial Account
→ Deploy Self-hosted JFrog Platform
→ Log in and configure Trial Account
→ Create Repository
→ Configure Insecure-registries in the docker
→ Push Docker image to JForg Artifacts
Sign up for a Free Trial Account
JFrog allows creating a one-month Community Trial account that can be used to get familiar with the JFrog Platform.
Navigate to https://jfrog.com/community/start-free URL, Choose the “Self-Hosted” option, and sign up for an account.
On success, You will receive an email with credentials. Save credentials, we need them later.
Deploy Self-hosted JFrog Platform
JFrog support many different OS options for hosted JFrog Platform such as Docker, Linux, and Windows. In my opinion, Running a Docker container is the easiest way to start a self-hosted. I will use the docker option but you are free to use other options.
// Create Volume
docker volume create artifactory-data// Pull JFrog image
docker pull releases-docker.jfrog.io/jfrog/artifactory-pro:latest// Launch a container
docker run -d --name artifactory -p 9092:8082 -p 9091:8081 -v artifactory-data:/var/opt/jfrog/artifactory releases-docker.jfrog.io/jfrog/artifactory-pro:latest// JFrog may take more than a minutes to start
Access the JFrog Platform — HTTP://<hostname>:9092
Log in and configure Trial Account
Navigate to HTTP://<hostname>:9092 and enter the username and password that you received via email. The Portal will ask you to reset the credentials and add the Demo license
Set your hostname(or IP) as a base URL
Click next and finish the configuration wizard.
Create Repository
You will be landing the onboarding page after finishing the Configuration Wizard. You can play dashboard UI. Let’s create your first local repository.
Click on the “Create a Repository” button.
I am gonna create a Local Repository so let’s click on the “Create Local Repository” button
Choose the repository type, I go for docker but you can choose anyone as per your requirement.
Add the repository name and other configuration (I suggest keeping the default configuration).
Configure Insecure-registries in the docker
Since we hosted the JFrog portal on an on-premise machine meaning this registry is insecure so to access it, we need to tell docker to trust this registry.
Configuring Insecure-registries in docker is effortless. Open Docker Dashboard → Settings → Docker Engine and add your host IP and port.
Push Docker image to JForg Artifacts
Okay! It’s time to push your docker image into the JFrog repository. I will push the ubuntu image.
First, let’s create a tag in “<hostname>:<port>/repository-key/<image-name>:<tag>” format
$docker pull ubuntu:18.04
$docker tag ubuntu:18.04 <host-IP>:9092/my-repo-key/ubuntu:18.04
$docker login http://<host-IP>:9092/v2
// Docker prompt credentials, enter your credentials
$docker push <host-IP>:9092/my-repo-key/ubuntu:18.04
$docker logout http://<host-IP>:9092/v2
Docker engine will puh the image to JFrom if everything goes smooth.
Go to the JFrog portal and check the newly pushed image.