@@ -7,7 +7,8 @@ ENV BASH_ENV=/home/app/.env
7
7
RUN groupadd -g 1000 app && \
8
8
useradd -g 1000 -u 1000 -m app
9
9
10
- RUN apt update && \
10
+ RUN --mount=type=cache,target=/var/cache/apt \
11
+ apt update && \
11
12
apt install -y git curl
12
13
13
14
USER 1000
@@ -22,7 +23,8 @@ FROM base AS build
22
23
23
24
USER root
24
25
25
- RUN apt install -y build-essential libreadline-dev zlib1g-dev libssl-dev libuuid1 uuid-dev unzip
26
+ RUN --mount=type=cache,target=/var/cache/apt \
27
+ apt install -y build-essential libreadline-dev zlib1g-dev libssl-dev libuuid1 uuid-dev unzip
26
28
27
29
COPY ./ /src
28
30
@@ -31,29 +33,15 @@ USER 1000
31
33
32
34
WORKDIR /src/rolling-shutter
33
35
34
- RUN make install-asdf && \
36
+ RUN --mount=type=cache,target=/home/app/.asdf/downloads,uid=1000,gid=1000 \
37
+ --mount=type=cache,target=/home/app/.asdf/tmp,uid=1000,gid=1000 \
38
+ make install-asdf
39
+
40
+ RUN --mount=type=cache,target=/home/app/.asdf/downloads,uid=1000,gid=1000 \
41
+ --mount=type=cache,target=/home/app/.asdf/tmp,uid=1000,gid=1000 \
42
+ --mount=type=cache,target=/home/app/.cache/go-build,uid=1000,gid=1000 \
43
+ make install-asdf && \
35
44
make install-tools && \
36
45
make build
37
46
38
- RUN go clean -cache -modcache
39
-
40
- FROM base AS run
41
-
42
- USER root
43
- RUN apt install make
44
-
45
- USER 1000
46
- RUN mkdir /home/app/.asdf/installs
47
- COPY --from=build /src /src
48
- COPY --from=build /home/app/.asdf/plugins/ /home/app/.asdf/plugins/
49
- COPY --from=build /home/app/.asdf/installs/babashka/ /home/app/.asdf/installs/babashka/
50
- COPY --from=build /home/app/.asdf/installs/clojure/ /home/app/.asdf/installs/clojure/
51
- COPY --from=build /home/app/.asdf/installs/golang/ /home/app/.asdf/installs/golang/
52
- COPY --from=build /home/app/.asdf/installs/java/ /home/app/.asdf/installs/java/
53
- COPY --from=build /home/app/.asdf/installs/nodejs/ /home/app/.asdf/installs/nodejs/
54
- COPY --from=build /home/app/.asdf/installs/postgres/ /home/app/.asdf/installs/postgres/
55
- COPY --from=build /home/app/.asdf/installs/solidity/ /home/app/.asdf/installs/solidity/
56
- RUN asdf reshim
57
-
58
-
59
47
WORKDIR /src
0 commit comments