forked from jfrogsolutionci/jfrog-distroless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.distroless
36 lines (27 loc) · 1.46 KB
/
Dockerfile.distroless
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# An example of customising Artifactory using the artifactory-java base image.
# Using Docker multi stage build.
# Taking the Artifactory file system (including java) and adding it to your custom distroless image.
# The Artifactory official Docker image
FROM docker.bintray.io/jfrog/artifactory-pro:6.9.1 AS artifactory
# This will be your custom distroless image. In this example it's artifactory-java:adoptopenjdk11-14
FROM docker.jfrog.io/jfrog/distroless/base/artifactory-java:adoptopenjdk11-14
USER root
# Environment needed for Artifactory
ENV ARTIFACTORY_USER_NAME=artifactory \
ARTIFACTORY_HOME=/opt/jfrog/artifactory \
ARTIFACTORY_DATA=/var/opt/jfrog/artifactory \
ARTIFACTORY_EXTRA_CONF=/artifactory_extra_conf \
RECOMMENDED_MAX_OPEN_FILES=32000 \
MIN_MAX_OPEN_FILES=10000 \
RECOMMENDED_MAX_OPEN_PROCESSES=1024
# Copy needed file system from artifactory (Artifactory offical image)
COPY --from=artifactory /opt/jfrog /opt/jfrog
COPY --from=artifactory /var/opt/jfrog/artifactory /var/opt/jfrog/artifactory
COPY --from=artifactory /artifactory_extra_conf /artifactory_extra_conf
COPY --from=artifactory /entrypoint-artifactory.sh /entrypoint-artifactory.sh
# Adjust file system ownership
RUN chown -R ${ARTIFACTORY_USER_NAME}:${ARTIFACTORY_USER_NAME} ${ARTIFACTORY_HOME} ${ARTIFACTORY_EXTRA_CONF} ${ARTIFACTORY_DATA}
USER ${ARTIFACTORY_USER_NAME}
VOLUME ${ARTIFACTORY_DATA}
VOLUME ${ARTIFACTORY_EXTRA_CONF}
ENTRYPOINT ["/entrypoint-artifactory.sh"]