My docker-compose.yml:
version: "3.8"
services:
web:
build:
context: .
args:
file_url: 'some-url'
My Dockerfile:
FROM ruby:2.7.4-bullseye
ARG file_url
RUN curl $file_url -L -o "file"
When I run:
docker-compose up --build
I expect Docker'd build and start my containers. But instead, I got:
Step 4/12 : RUN curl $file_url -L -o "file"
---> Running in 59696c6274c7
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
So obviously the build args are not passing to Dockerfile. I've read a lot of similar threads on Stackoverflow but couldn't figure out what went wrong.
One more thing. I can actually build the containers with docker-compose build web just fine. It's just when I run docker-compose up --build or docker-compose up the error occurred.