Closed dkorpel closed 1 year ago
What does this error mean?
> [dependencies-cache 2/2] RUN dub --cache=local build:
#13 15.79 Fetching mustache-d 0.1.5 (getting selected version)...
#13 16.90 Fetching diet-ng 1.8.1 (getting selected version)...
#13 18.04 Fetching openssl 3.2.2 (getting selected version)...
#13 19.37 Fetching dyaml 0.9.2 (getting selected version)...
#13 20.84 Fetching mir-linux-kernel 1.0.1 (getting selected version)...
#13 21.96 Fetching libdparse 0.22.0 (getting selected version)...
#13 23.16 Fetching dfmt 0.14.2 (getting selected version)...
#13 24.52 Invalid source/import path: /src/.dub/packages/dfmt-0.14.2/dfmt/bin
#13 24.53 Running pre-generate commands for dfmt...
#13 26.44 Invalid variable: DC
------
Dockerfile:31
--------------------
29 | FROM base AS dependencies-cache
30 | COPY --from=dub-cache /out .
31 | >>> RUN dub --cache=local build
32 |
33 | # ------------------------------- App builders ------------------------------- #
--------------------
ERROR: failed to solve: process "/bin/sh -c dub --cache=local build" did not complete successfully: exit code: 2
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c dub --cache=local build" did not complete successfully: exit code: 2
#13 26.44 Invalid variable: DC
Uh oh, I think we also need to update dub, which you will do by updating the alpine image (https://github.com/dlang-tour/core/blob/master/Dockerfile#L1).
EDIT: Except we're already on 3.16
I didn't update dfmt, why can it not build anymore?
@dkorpel :
diff --git a/Dockerfile b/Dockerfile
index 67e87db..c2abd9a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,7 @@
-ARG BASE_IMAGE=alpine:3.16
+# Use edge to get dub v1.30 instead of v1.28 (3.16),
+# as we otherwise hit https://github.com/dlang/dub/issues/2192
+# Change to alpine:3.17 when released.
+ARG BASE_IMAGE=alpine:edge
# ----------------------------------- Base ----------------------------------- #
FROM $BASE_IMAGE AS base
@@ -53,7 +56,7 @@ RUN dub --cache=local run -- --sanitycheck
# Runner #
# ---------------------------------------------------------------------------- #
FROM $BASE_IMAGE as runner-cache
-RUN apk --no-cache add ldc-runtime libexecinfo libgcc tzdata docker-cli
+RUN apk --no-cache add ldc-runtime libgcc tzdata docker-cli
EXPOSE 8080
WORKDIR /app
Still testing locally (build is slow) but that might solve your problems.
@Geod24 Can you add a new tag so buildkite picks this up?
Thank you @dkorpel and @Geod24!
Trying to unblock https://github.com/dlang/dmd/pull/14891