Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannt read variable from docker compose build --build-arg xx=xx #376

Open
YesPass opened this issue Aug 3, 2023 · 0 comments
Open

cannt read variable from docker compose build --build-arg xx=xx #376

YesPass opened this issue Aug 3, 2023 · 0 comments

Comments

@YesPass
Copy link

YesPass commented Aug 3, 2023

version: '3.1'
services:
  sample:
    restart: always
    build:
      context: ./ 
      dockerfile: Dockerfile
      args:
        GOLDFLAGS: "${GOLDFLAGS?err}"
    image: sample:1.0.0
    container_name: sample0
    ports:
      - 8080:8080
    environment:
      TZ: Asia/Shanghai

it appears error

error while interpolating services.sample.build.args.GOLDFLAGS: required variable GOLDFLAGS is missing a value: err

when execute command

 docker compose build --build-arg GOLDFLAGS="-s -w"

docker version :4.21.1
docker compose version: 2.19.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant