This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
49 lines (37 loc) · 1.65 KB
/
Dockerfile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM golang:1.14.4 AS buildTVSI
COPY . /vaultsidecarinjector
RUN cd /vaultsidecarinjector && make build OFFLINE=true
FROM centos:7.9.2009 AS baseImage
# Update CentOS (note that --security flag does not work on CentOS: https://forums.centos.org/viewtopic.php?t=59369)
RUN set -x \
&& yum -y update \
&& yum clean all \
&& rm -rf /var/cache/yum
FROM scratch
USER root
# Talend home, Talend user/user group/user id
ENV TALEND_HOME=/opt/talend
ENV TALEND_USER=talend
ENV TALEND_USERGROUP=$TALEND_USER
ENV TALEND_UID=61000
COPY --from=baseImage / /
# Create non-root user $TALEND_USER
RUN set -x \
&& mkdir -p $TALEND_HOME \
&& groupadd -r $TALEND_USERGROUP -g $TALEND_UID \
&& useradd -l -u $TALEND_UID -r -g $TALEND_USERGROUP -m -d /home/$TALEND_USER -s /sbin/nologin $TALEND_USER \
&& chmod 755 /home/$TALEND_USER \
&& chmod -R "g+rwX" $TALEND_HOME \
&& chown -R $TALEND_USER:$TALEND_USERGROUP $TALEND_HOME
WORKDIR $TALEND_HOME
USER $TALEND_UID
LABEL com.talend.maintainer="Talend <support@talend.com>" \
com.talend.url="https://www.talend.com/" \
com.talend.vendor="Talend" \
com.talend.name="Vault Sidecar Injector" \
com.talend.application="talend-vault-sidecar-injector" \
com.talend.service="talend-vault-sidecar-injector" \
com.talend.description="Kubernetes Webhook Admission Server for Vault sidecar injection"
COPY --chown=talend:talend --from=buildTVSI /vaultsidecarinjector/target/vaultinjector-webhook ${TALEND_HOME}/webhook/
COPY --chown=talend:talend --from=buildTVSI /vaultsidecarinjector/target/vaultinjector-env ${TALEND_HOME}/
ENTRYPOINT ["/opt/talend/webhook/vaultinjector-webhook"]