Closed ekeih closed 10 months ago
Thanks for researching the issue this thoroughly!
With all this information, I agree with your proposal of failing forward. This decision is also made easier by the fact that the release of v4.0.0 is just days away, if at all.
However, I would also like to revert back to docker
for now so that we have a clean upgrade path (upgrading the major will entail upgrading to the latest patch version of the major version before from v4.0.0 on).
Two questions:
The existing Docker image is not used by ko at all, it can be deleted when using ko.
, can we delete the Dockerfile.goreleaser
with this?cgr.dev/chainguard/static
only has a latest tag, did you see a way to pin the digest of the image somewhere during your research?However, I would also like to revert back to docker for now so that we have a clean upgrade path (upgrading the major will entail upgrading to the latest patch version of the major version before from v4.0.0 on).
Sounds like a good idea 👍
What do you mean by The existing Docker image is not used by ko at all, it can be deleted when using ko., can we delete the Dockerfile.goreleaser with this?
Ah sorry, I meant to write Dockerfile. Yes, we can delete Dockerfile.goreleaser
when we switch to ko
with v4. https://ko.build/advanced/migrating-from-dockerfile/ says You're done. You can delete your Dockerfile and uninstall docker.
at the bottom.
Since cgr.dev/chainguard/static only has a latest tag, did you see a way to pin the digest of the image somewhere during your research?
I didn't see any documentation that this is possible. I also didn't see any saying it is not. But my gut feeling is that it is not possible.
ℹ️ I stopped my backend instance, ran chown 65532:65532
on the sqlite file and its parent directory, started the new backend version (v3.22.1) and everything worked.
I added the change back with #915, check the upgrade docs for v4.0.0.
Thanks again for the research!
Describe the bug
After upgrading to
v3.22.1
the backend crashes witherror during DB migration: attempt to write a readonly database
. This happens because the backend is now running as usernonroot
with uid and gid65532
(or at least that is what I think based on the documentation, see below).To Reproduce Steps to reproduce the behavior:
v3.22.1
docker image.Expected behavior The backend should not crash and it should be able to write to existing sqlite databases.
Additional context
docker
toko
. The existing Docker image is not used byko
at all, it can be deleted when usingko
.ko
usescgr.dev/chainguard/static
as base image for all builds by default (according to https://ko.build/configuration/#overriding-base-images).has a single user nonroot with uid 65532, belonging to gid 65532
.scratch
image with the default user/grouproot
.65532
does not have write permissions to the existing sqlite file.Switching to
scratch
withko
is not possibleko
to thescratch
image.Proposal
cgr.dev/chainguard/static
image only has a latest tag, so future changes in the base image could cause issues in the future. Though, the image should be fairly minimal overall. An alternative could be to use another base image or create our own.docker
in the meantime.