-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile.acceptance-testing.worker
39 lines (37 loc) · 1.45 KB
/
Dockerfile.acceptance-testing.worker
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
FROM golang:1.22.5-alpine3.19 as builder
WORKDIR /go/src/github.com/mendersoftware/workflows
RUN mkdir -p /etc_extra
RUN echo "nobody:x:65534:" > /etc_extra/group
RUN echo "nobody:!::0:::::" > /etc_extra/shadow
RUN echo "nobody:x:65534:65534:Nobody:/:" > /etc_extra/passwd
RUN chown -R nobody:nobody /etc_extra
RUN apk add --no-cache \
git \
xz-dev \
musl-dev \
ca-certificates \
gcc
COPY ./ .
RUN env CGO_ENABLED=0 go build \
-tags acceptance -o workflows \
-cover -covermode atomic \
-coverpkg $(go list -deps | \
grep '^github.com/mendersoftware/workflows' | \
tr '\n' ,)
FROM scratch
EXPOSE 8080
COPY --from=builder /etc_extra/ /etc/
USER 65534
COPY --from=builder --chown=nobody /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder --chown=nobody /tmp /tmp
COPY --chown=nobody ./worker/workflows /etc/workflows/definitions
COPY --chown=nobody ./worker/data /etc/workflows/data
COPY --chown=nobody ./worker/config.yaml /etc/workflows/config.yaml
COPY --from=builder --chown=nobody /go/src/github.com/mendersoftware/workflows/workflows /usr/bin/
ENTRYPOINT [ \
"/usr/bin/workflows", \
"--config=/etc/workflows/config.yaml", \
"worker", "--automigrate", \
"--workflows=decommission_device,deploy_device_configuration,provision_device,update_device_status,update_device_inventory,reindex_reporting,reindex_reporting_deployment,reindex_inventory", \
"--excluded-workflows=generate_artifact" \
]