-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (26 loc) · 1.1 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
# syntax=docker/dockerfile:1
FROM golang:1.20.4 AS build
ENV CGO_ENABLED=0
# TODO: mount the caches from the host system, having first established and
# switched to a user with the same UID and GID as the caller.
RUN \
--mount=type=cache,target=/cache/gocache \
--mount=type=cache,target=/cache/gomodcache \
export GOCACHE=/cache/gocache GOMODCACHE=/cache/gomodcache && \
go install -trimpath github.com/rogpeppe/go-internal/cmd/testscript@v1.10.0
RUN \
--mount=type=cache,target=/cache/gocache \
--mount=type=cache,target=/cache/gomodcache \
export GOCACHE=/cache/gocache GOMODCACHE=/cache/gomodcache && \
go install -trimpath cuelang.org/go/cmd/cue@v0.6.0-alpha.1
FROM debian@sha256:63d62ae233b588d6b426b7b072d79d1306bfd02a72bff1fc045b8511cc89ee09
RUN mkdir -p /go/bin
ENV PATH="/go/bin:${PATH}"
WORKDIR /
COPY ./entrypoint.sh /usr/bin/entrypoint.sh
RUN chown root:root /usr/bin/entrypoint.sh
RUN chmod 755 /usr/bin/entrypoint.sh
RUN chown root:root /usr/bin/entrypoint.sh
COPY --from=build /go/bin/testscript /go/bin
COPY --from=build /go/bin/cue /go/bin
ENTRYPOINT ["/usr/bin/entrypoint.sh"]