Is it possible to bootstrap Artifactory-OSS Docker image with Kubernetes Deployment and PVC?
Our solution was to modify their /entrypoint-artifactory.sh
and create a custom image.
First, we added a new function copyExtraConf()
to /etnrypoint-artifactory.sh
copyExtraConf () { logger "Copying from artifactory_extra_conf" chown ${ARTIFACTORY_USER_NAME}:${ARTIFACTORY_USER_NAME} /artifactory_extra_conf/* cp -pv /artifactory_extra_conf/* ${ARTIFACTORY_HOME}/etc/}
Then we called it after we've setup directories and users to prevent ownership errors of a mounted volume:
printDockerFileLocationcheckULimitscheckMountssetupDataDirssetupArtUser# CUSTOM:START - do this after setupDataDirs and setupArtUser so we can chown and copy our files.copyExtraConf# CUSTOM:ENDsetAccessCredssetMasterKeysetupPermissionssetDBTypeaddExtraJavaArgs
Dockerfile:
# Dockerfile## NOTE:# entrypoint-artifactory.sh is based on the one from artifactory-oss:6.1.0# When changing versions, be sure to compare entrypoint-artifactory-ta.sh to entrypoint-artifactory.shFROM docker.bintray.io/jfrog/artifactory-oss:6.1.0COPY entrypoint-artifactory.sh /entrypoint-artifactory.shRUN chmod +x /entrypoint-artifactory.shENTRYPOINT ["/entrypoint-artifactory.sh"]COPY configs/artifactory.config.import.xml /artifactory_extra_conf/artifactory.config.import.xmlCOPY configs/security.import.xml /artifactory_extra_conf/security.import.xml
I had to become root in order to exchange the /entrypoint-artifactory.sh
FROM docker.bintray.io/jfrog/artifactory-oss:6.16.0USER rootCOPY entrypoint-artifactory.sh /entrypoint-artifactory.shRUN chmod +x /entrypoint-artifactory.shCOPY configs/artifactory.config.import.xml /artifactory_extra_conf/COPY configs/security.import.xml /artifactory_extra_conf/USER artifactoryENTRYPOINT ["/entrypoint-artifactory.sh"]