The documentation states the following:
Anywhere Docker accepts an environment-variable value, write se://<id|pattern> and the engine resolves it just before the container starts.
This does not appear to apply to docker compose build. Here's a minimal project demonstrating the issue:
Dockerfile:
FROM alpine:latest AS base
WORKDIR /test
RUN --mount=type=secret,id=test_auth,env=TEST_AUTH \
echo $TEST_AUTH > result.txt
CMD ["cat", "/test/result.txt"]
docker-compose.yml
services:
app:
build:
context: .
dockerfile: ./Dockerfile
secrets:
- test_auth
secrets:
test_auth:
environment: se://TEST_AUTH
Reproduction:
docker pass plugins enable 1password-cli
docker pass set TEST_AUTH="Hello world!"
docker compose build
docker compose run --rm app
Expected output: Hello world!
Actual output: Nothing
The documentation states the following:
This does not appear to apply to
docker compose build. Here's a minimal project demonstrating the issue:Dockerfile:
docker-compose.yml
Reproduction:
Expected output:
Hello world!Actual output: Nothing