this post was submitted on 07 Aug 2023
7 points (100.0% liked)

Programming

13362 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 1 year ago
MODERATORS
 

I would like to contribute to lemmy but I have issue with the docker image. I got this error when trying to execute docker-compose up : "ERROR: Service 'lemmy' failed to build: the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled"

I executed the commands that was in the link in the error message and I still have the same issue.

top 2 comments
sorted by: hot top controversial new old
[โ€“] Penguincoder@beehaw.org 3 points 1 year ago

Building is different than doing a compose up. If you're making changes to the dockerfile and want to build your changes, then DOCKER_BUILDKIT=1 docker build -t custom/lemmy: . should be the correct method.

Then you would change the docker-compose file to reference your newly built image instead of using the docker hub one. See this document.

[โ€“] ptz@dubvee.org 3 points 1 year ago* (last edited 1 year ago)

If you enabled BuildKit globally in daemon.json config, you'll need to restart the docker daemon (systemctl restart docker). If you're enabling it for a one-off build, you'll need to run the build like this:

DOCKER_BUILDKIT=1 docker build -t lemmy:latest .

I had to update some build scripts for a few other projects, and that worked.