Jfrog Artifactory 2019 Cluster in Ubuntu

JfrogArtifactory2019ClusterinUbuntu

Igotothepageanddownloadthefile

https://jfrog.com/open-source/#artifactory

ThefileIdownloadisjfrog-artifactory-oss-6.8.4.zip

Unzipthefileandplaceinworkingdirectory.

Changethebin/artifactory.defaultasfollow:

>catbin/artifactory.default

#!/bin/sh

#Defaultvalues

exportARTIFACTORY_HOME=/opt/artifactory

exportARTIFACTORY_USER=carl

exportJAVA_HOME=/opt/jdk

#exportSTART_LOCAL_REPLICATOR=true

#exportSTART_LOCAL_MDS=true

exportTOMCAT_HOME=$ARTIFACTORY_HOME/tomcat

exportARTIFACTORY_PID=$ARTIFACTORY_HOME/run/artifactory.pid

exportJAVA_OPTIONS="-server-Xms512m-Xmx2g-Xss256k-XX:+UseG1GC-XX:OnOutOfMemoryError=\"kill-9%p\""

exportJAVA_OPTIONS="$JAVA_OPTIONS-Djruby.bytecode.version=1.8-Djruby.compile.invokedynamic=false-Dfile.encoding=UTF8-Dartdist=zip-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true-Djava.security.egd=file:/dev/./urandom"

#Timeoutwaitingforartifactorytostart

#START_TMO=60

Commandtostart

>bin/artifactory.shstart

Itisworkingnow.ThenIwillbuildtheDockermanually.

HereistheDockerfileIuse

#Runanartifactory

#PreparetheOS

FROMubuntu:16.04

MAINTAINERRachelKang<[email protected]>

ENVDEBIAN_FRONTENDnoninteractive

ENVJAVA_HOME/usr/lib/jvm/java-8-oracle

ENVLANGen_US.UTF-8

ENVLC_ALLen_US.UTF-8

RUNapt-get-qqupdate

RUNapt-get-qqydist-upgrade

#Preparethedenpendencies

RUNapt-getinstall-qywgetunzipvim

RUNapt-getinstall-qyiputils-ping

#InstallSUNJAVA

RUNapt-getupdate&&\

apt-getinstall-y--no-install-recommendslocales&&\

locale-genen_US.UTF-8&&\

apt-getdist-upgrade-y&&\

apt-get--purgeremoveopenjdk*&&\

echo"oracle-java8-installershared/accepted-oracle-license-v1-1selecttrue"|debconf-set-selections&&\

echo"debhttp://ppa.launchpad.net/webupd8team/java/ubuntuxenialmain">/etc/apt/sources.list.d/webupd8team-java-trusty.list&&\

apt-keyadv--keyserverkeyserver.ubuntu.com--recv-keysEEA14886&&\

apt-getupdate&&\

apt-getinstall-y--no-install-recommendsoracle-java8-installeroracle-java8-set-default&&\

apt-getcleanall

#addthesoftwareartifactory

ADDinstall/jfrog-artifactory-oss-6.8.4.zip/tool/

WORKDIR/tool/

RUNunzipjfrog-artifactory-oss-6.8.4.zip

RUNrm-frjfrog-artifactory-oss-6.8.4.zip

RUNln-s/tool/artifactory-oss-6.8.4/tool/artifactory

ADDconf/artifactory.default/tool/artifactory/bin/

ADDconf/binarystore.xml/tool/artifactory/etc/

#setuptheapp

EXPOSE8081

RUNmkdir-p/app/

ADDstart.sh/app/

WORKDIR/app/

CMD["./start.sh"]

Makefiletosupportthestart/stopCommands

PORT=8081

IMAGE=sillycat/public

TAG=ubuntu-artifactory-1.0

NAME=ubuntu-artifactory-1.0-$(PORT)

docker-context:

build:docker-context

dockerbuild-t$(IMAGE):$(TAG).

run:

dockerrun\

-d\

-uroot\

-p$(PORT):8081\

-v$(shellpwd)/artifactory-data:/var/opt/jfrog/artifactory\

-v/var/run/docker.sock:/var/run/docker.sock\

--name$(NAME)\

$(IMAGE):$(TAG)

debug:

dockerrun-ti-p$(PORT):8081--name$(NAME)$(IMAGE):$(TAG)/bin/bash

clean:

dockerstop${NAME}

dockerrm${NAME}

logs:

dockerlogs${NAME}

publish:

dockerpush${IMAGE}

Hereisthestart.shCommand

#!/bin/sh-ex

#starttheservice

cd/tool/artifactory

bin/artifactory.shstart

touch/tool/artifactory/logs/artifactory.log

tail-f/tool/artifactory/logs/artifactory.log

HereistheConfigureFileconf/artifactory.default

#!/bin/sh

#Defaultvalues

exportARTIFACTORY_HOME=/tool/artifactory

exportARTIFACTORY_USER=root

exportJAVA_HOME=/usr/lib/jvm/java-8-oracle

#exportSTART_LOCAL_REPLICATOR=true

#exportSTART_LOCAL_MDS=true

exportTOMCAT_HOME=$ARTIFACTORY_HOME/tomcat

exportARTIFACTORY_PID=$ARTIFACTORY_HOME/run/artifactory.pid

exportJAVA_OPTIONS="-server-Xms512m-Xmx2g-Xss256k-XX:+UseG1GC-XX:OnOutOfMemoryError=\"kill-9%p\""

exportJAVA_OPTIONS="$JAVA_OPTIONS-Djruby.bytecode.version=1.8-Djruby.compile.invokedynamic=false-Dfile.encoding=UTF8-Dartdist=zip-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true-Djava.security.egd=file:/dev/./urandom"

#Timeoutwaitingforartifactorytostart

#START_TMO=60

Hereistheconfigurationfileconf/binarystore.xml

<?xmlversion="1.0"encoding="UTF-8"?>

<configversion="1">

<chaintemplate="file-system"/>

<providerid="file-system"type="file-system">

<fileStoreDir>/tool/artifactory/m2</fileStoreDir>

</provider>

</config>

Checkstatuscode

>curl-s-o/dev/null-w"%{http_code}"http://localhost:49100/

HealthcheckURL

>curl-s-o/dev/null-w"%{http_code}"http://localhost:49100/artifactory/api/system/ping

200

References:

https://www.jfrog.com/confluence/display/RTF5X/Installing+with+Docker

https://www.jfrog.com/confluence/pages/viewpage.action?pageId=59082305

https://www.jfrog.com/confluence/display/RTF4X/Configuring+the+Filestore

相关推荐