Skip to content
Advertisement

How to pull composer install inside docker container for Jfrog artifcatory

PHP package are install through Jfrog artifact URL using composer.json file. Need to get PHP package using composer install command inside docker container. This docker container manage by Jenkins pipeline. WHen I am doing locally it asked username and password on terminal

JavaScript

Then it stored auth value under /home/vagrant/.composer/auth.json similar thing need to do in docker while deployment. what is way to do this ?

Advertisement

Answer

I got answer finally!

Jfrogtoken is configured under your Jenkins portal for token values.

Jenkins file you can add like this

JavaScript

Pass this to docker file using --build-arg like

--build-arg jfrog_user=$jfrog_user --build-arg jfrog_token=$jfrog_token

Then you will received this params in Dockerfile under ARG value.

Then run this command before composer install. portal-url will be your jfrog account like example.jfrog.io

composer config --global http-basic.portal-url $jfrog_user $jfrog_token

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement