-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.50
42 lines (36 loc) · 1.4 KB
/
Dockerfile.50
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
FROM alpine:latest as base
RUN apk --no-cache add bash openjdk11-jdk
FROM base as dataloader
RUN apk --no-cache add git maven
WORKDIR /tmp
RUN git clone https://github.com/forcedotcom/dataloader.git && \
cd dataloader && \
git checkout v50.0.0 && \
git submodule init && \
git submodule update && \
mvn clean package -DskipTests
FROM base
WORKDIR /opt/app
RUN mkdir configs && mkdir libs
COPY --from=dataloader /tmp/dataloader/target/dataloader-*-uber.jar ./dataloader.jar
COPY --from=dataloader /tmp/dataloader/release/mac/configs ./configs/sample
ARG JOBBER_VERSION=1.4.0
ENV USER=dataloader
ENV USER_ID=1000
RUN addgroup ${USER} && adduser -S -u "${USER_ID}" ${USER}
RUN wget -O /tmp/jobber.apk "https://github.com/dshearer/jobber/releases/download/v${JOBBER_VERSION}/jobber-${JOBBER_VERSION}-r0.apk" && \
apk add --no-network --no-scripts --allow-untrusted /tmp/jobber.apk && \
rm /tmp/jobber.apk && \
mkdir -p "/var/jobber/${USER_ID}" && \
chown -R ${USER} "/var/jobber/${USER_ID}"
COPY --chown=${USER} jobber.yaml /home/${USER}/.jobber
RUN chown -R ${USER} configs && \
chown -R ${USER} libs && \
chmod 0600 /home/${USER}/.jobber
COPY dataloader.50 ./dataloader
RUN chmod +x dataloader
ENV PATH=/opt/app:${PATH}
USER ${USER}
VOLUME ["/opt/app/configs"]
VOLUME ["/opt/app/libs"]
CMD ["/usr/libexec/jobberrunner", "-u", "/var/jobber/1000/cmd.sock", "/home/dataloader/.jobber"]