Monday, January 30, 2023

Install Artifactory using Docker Compose | Install Artifactory using Docker Compose on Ubuntu 22.0.4 | How to Setup JFrog Artifactory using Docker-Compose

How to setup Artifactory using Docker Compose?

Artifactory is open source, binary repository manager. Artifactory is the single solution for managing all the artifacts, binaries, files and containers throughout your software supply chain. 

Some of the key features of Artifactory:
  • Supports 27 different package types including helm charts, docker images regardless of tech stack.
  • A single source of truth for all your binaries
  • Integration with all CICD tools
  • role based authorization with teams to manage artifacts 
  • you can create local, remote and virtual repositories
What is Docker Compose?
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. Since Docker Compose lets you configure related containers in a single YAML file, you get the same Infrastructure-as-Code abilities as Kubernetes. But they come in a simpler system that’s more suited to smaller applications that don’t need Kubernetes’ resiliency and scaling.
 
The purpose of docker-compose is to function as docker cli but to issue multiple commands much more quickly. To make use of docker-compose, you need to encode the commands you were running before into a docker-compose.yml file
 
Run docker-compose up and Compose starts and runs your entire app.

Watch the Steps in YouTube channel:

Pre-requisites:
  • Ubuntu EC2 up and running with at least t2.medium (4GB RAM), 2GB will not work
  • Port 8081, 8082 is opened in security firewall rule
  • instance should have docker-compose installed

Change Host Name to Artifactory
sudo hostnamectl set-hostname Artifactory

Perform System update
sudo apt update

Install Docker-Compose
sudo apt install docker-compose -y

Create docker-compose.yml
this yml has all the configuration for installing Artifactory on Ubuntu EC2.
sudo vi docker-compose.yml 

(Copy the below code high-lighted in yellow color)
version: "3.3"
services:
  artifactory-service:
    image: docker.bintray.io/jfrog/artifactory-oss:7.49.6
    container_name: artifactory
    restart: always
    networks:
      - ci_net
    ports:
      - 8081:8081
      - 8082:8082
    volumes:
      - artifactory:/var/opt/jfrog/artifactory

volumes:
  artifactory:
networks:
  ci_net:

Save the file by entering :wq!

Now execute the compose file using Docker compose command to start Artifactory Container
sudo docker-compose up -d 

-d means detached mode

Make sure Artifactory is up and running
sudo docker-compose logs --follow


Once you see the message, that's it. Artifactory is been setup successfully. Now press Control C and enter to come out of the above screen.

Check Artifactory is up and running by typing below command:
curl localhost:8081
This confirms that Artifactory is up and running locally.

How to access Artifactory in the browser?
Now access Artifactory UI by going to browser and enter public dns name with port 8081
http://change to_artifactory_publicdns_name:8081

default user name is admin
password is password


After Login, click on Get started. 

Now reset admin password. enter new admin password 

Skip for base URL and skip proxy setup
Click Next, click on Finish




How to integrate Artifactory with Jenkins?

How to stop Artifactory container
sudo docker-compose down




No comments:

Post a Comment

DevSecOps Bootcamp Dec 2024 Schedule | DevSecOps & AWS Azure Cloud Coaching by Coach AK | DevSecOps and Cloud Computing Online Classes

Lot of new topics covered like GitHub Actions, GitHub Advanced Security, Helm, Prometheus and Grafana..) The DevOps requirements in the IT m...