Bruno Bernardino
Bruno Bernardino•9h ago

[Fresh] Docker build issue in CI after upgrading from v1 to v2

Alright, so I've been upgrading Fresh from v1 to v2 in bewCloud (https://bewcloud.com) for a while, and gave up a couple of times, but finally got everything working. It also builds in Docker locally without issues and everything seems to be fine. I really dislike the use of vite but couldn't get around it, unfortunately. Builds and tests got slower, but I guess that's the price for getting some progress. The app itself seems to have suffered no big problem. But I digress; the main issue I'm currently having, which is preventing a new release, is the fact that it fails to build a docker image in CI. It fails with a really weird error, about the deno.lock file:
...
#19 10.87 Task build vite build
...
#19 28.44 error during build:
#19 28.44 Error: Failed reading lockfile at '/app/deno.lock': Unsupported lockfile version ''. Try upgrading Deno or recreating the lockfile
#19 28.44 at __wbindgen_error_new (https://jsr.io/@deno/loader/0.3.6/src/lib/rs_lib.internal.js:1153:15)
...
------
Dockerfile:15
--------------------
13 |
14 | # Build fresh
15 | >>> RUN deno task build
16 |
17 | RUN chown -R deno:deno /app /deno-dir
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c deno task build" did not complete successfully: exit code: 1
...
#19 10.87 Task build vite build
...
#19 28.44 error during build:
#19 28.44 Error: Failed reading lockfile at '/app/deno.lock': Unsupported lockfile version ''. Try upgrading Deno or recreating the lockfile
#19 28.44 at __wbindgen_error_new (https://jsr.io/@deno/loader/0.3.6/src/lib/rs_lib.internal.js:1153:15)
...
------
Dockerfile:15
--------------------
13 |
14 | # Build fresh
15 | >>> RUN deno task build
16 |
17 | RUN chown -R deno:deno /app /deno-dir
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c deno task build" did not complete successfully: exit code: 1
You can see the current code in https://github.com/bewcloud/bewcloud with the Dockerfile at https://github.com/bewcloud/bewcloud/blob/main/Dockerfile and the CI action https://github.com/bewcloud/bewcloud/blob/main/.github/workflows/build-docker-image.yml#L46-L54 I'm not sure what to do, here. Docker builds locally, and the deno.lock file is there and is valid. If I remove it, it'll fail trying to resolve some dependencies (both locally and in CI).
12 Replies
fry69
fry69•9h ago
I guess the Deno version in
FROM denoland/deno:ubuntu-2.5.1
FROM denoland/deno:ubuntu-2.5.1
may be outdated? I use
FROM docker.io/denoland/deno:latest
FROM docker.io/denoland/deno:latest
and sometimes even (for testing)
RUN deno upgrade canary
RUN deno upgrade canary
Bruno Bernardino
Bruno BernardinoOP•9h ago
Thanks. There is a 2.5.2 released a couple of days ago, but that would not really explain it, and it's not really outdated. I want to stick it to a version I've tested. I just simplified the dockerfile and now get a core dump Fun.
fry69
fry69•9h ago
Well, this works for me -> https://github.com/fry69/orw/blob/fresh-vite/orw-deno/Containerfile Except for the nodeModulesDir -> auto bug (should be manual to avoid messing with the said folder during build and at best all times currently, that is Deno bug), I not yet found a way to break or disappoint me.
Bruno Bernardino
Bruno BernardinoOP•9h ago
Oooh. I just realized the error is actually only happening in linux arm64, not linux amd64. I'll try upgrading, maybe it was some more "behind-the-scenes" bug.
fry69
fry69•9h ago
Side note: Instead of deleting stuff after copying it into the image, you can use a .dockerignore file -> https://github.com/fry69/orw/blob/fresh-vite/orw-deno/.dockerignore
Bruno Bernardino
Bruno BernardinoOP•9h ago
Oh, it's not copied, but I "double check" there. It's already in the .dockerignore if you check it.
fry69
fry69•9h ago
Well, it is bit overkill. The image gets created fresh and if you do not copy those things in, they are not there 🙂
Bruno Bernardino
Bruno BernardinoOP•9h ago
So it's a quick command 😉
fry69
fry69•9h ago
It is not just a quick command, you create another layer with it.
Bruno Bernardino
Bruno BernardinoOP•9h ago
Ah, that's a good point Alright, it's still failing on arm64. I'm pretty sure this is indicative of some deeper bug in Deno, but I don't want to spend too much time looking into it right now. For now I'll just disable arm64 and keep amd64, for the new release.
fry69
fry69•9h ago
Yep, I only have tested AMD64 and AARCH64 (Apple Silicon), not ARM64/Linux.
Bruno Bernardino
Bruno BernardinoOP•9h ago
Same here, arm64 was in CI. I won't mark this as resolved to give the team an opportunity to look into it.

Did you find this page helpful?