-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
41 lines (35 loc) · 1.15 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
ARG base_image
ARG builder_image=concourse/golang-builder
FROM busybox:uclibc as busybox
FROM ${builder_image} as builder
COPY . /src
WORKDIR /src
ENV CGO_ENABLED 0
RUN go mod download
RUN go build -o /assets/in ./cmd/in
RUN go build -o /assets/out ./cmd/out
RUN go build -o /assets/check ./cmd/check
FROM paketobuildpacks/build-jammy-base as bash-builder
USER root
RUN apt-get -y update && apt-get -y install bash-static
# there are no tests, but all resources must have a 'tests' target, so just
# no-op
FROM scratch AS tests
FROM ${base_image} AS resource
USER root
COPY --from=busybox /bin/sleep /bin/
COPY --from=busybox /bin/printenv /bin/
COPY --from=busybox /bin/env /bin/
COPY --from=busybox /bin/mkdir /bin/
COPY --from=busybox /bin/nslookup /bin/
COPY --from=busybox /bin/touch /bin/
COPY --from=busybox /bin/true /bin/
COPY --from=busybox /bin/false /bin/
COPY --from=busybox /bin/find /bin/
COPY --from=busybox /bin/mkfifo /bin/
COPY --from=busybox /bin/sed /bin/
COPY --from=busybox /bin/wc /bin/
COPY --from=busybox /bin/rm /bin/
COPY --from=bash-builder /bin/bash-static /bin/bash
COPY --from=builder assets/ /opt/resource/
RUN chmod +x /opt/resource/*