You can't (yet) pass arguments to buildkit with docker-compose

docker-compose Since docker-compose can easily operate the container with up and down, it is used when trying the container locally. I checked if it could be used with buildkit. Leave for reminder

buildkit There is a case to access the private repository of github in the build with docker, I am passing a secret with the function of buildkit

DOCKER_BUILDKIT=1 docker build --secret id=token,src=.token .

Conclusion

I wanted to use this with docker-compose, so I checked it, but it seems that it can not be used as of January 2021.

By setting COMPOSE_DOCKER_CLI_BUILD = 1, it seems that you can build using buildkit. https://blog.pokutuna.com/entry/caching-docker-and-docker-compose

However, there seems to be no option to pass secret http://docs.docker.jp/v1.12/compose/compose-file.html

Since the PR of docker-compose is not open, it seems that it is not supported https://github.com/docker/compose/pull/7046

Recommended Posts

You can't (yet) pass arguments to buildkit with docker-compose
lombok.config when you want to pass @Qualifier to @RequiredArgsConstructor with lombok
I want to pass the startup command to postgres with docker-compose.
[Rails] What to do if you can't get parameters with form_with
If you dare to compare Integer with "==" ...
How to monitor nginx with docker-compose with datadog
(RubyMine) Check when you cannot debug with docker-compose
You use context to use MDC with Spring WebFlux
Error deploying rails5 + Mysql to heroku with Docker-compose
I can't do docker-compose up -d with docker
Use the --build-arg option of docker-compose to pass environment variables to the container built with Dockerfile