-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
dockerfile_inline limitations #18566
Comments
In an ecosystem where buildpacks, helm charts, and the like. I would argue for the opposite and allow it to fully replace a Dockerfile. |
|
Closing this issue as "work as documented" |
Here's a simple example which uses
ARG PHP_VERSION=8.2
FROM php:${PHP_VERSION} This does not work with
version: '3.9'
services:
php:
build:
context: .
dockerfile_inline: |
ARG PHP_VERSION=8.2
FROM php:${PHP_VERSION} $ docker compose up -d
WARN[0000] The "PHP_VERSION" variable is not set. Defaulting to a blank string.
[+] Building 0.0s (2/2) FINISHED docker:default
=> [php internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 68B 0.0s
=> [php internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
failed to solve: failed to parse stage name "php:": invalid reference format |
in your example, dockerfile_inline: |
ARG PHP_VERSION=8.2
FROM php:$${PHP_VERSION} |
@ndeloof Thanks for the explanation! |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. /lifecycle locked |
Is this a docs issue?
Type of issue
Information is incorrect
Description
The
dockerfile_inline
documentation shows a basic example on how to use multi-line syntax to pass the contents of a Dockerfile, but it seems that it cannot replace a Dockerfile out of the box, as I noticed instructions likeARG
do not work.I've noticed that it was already stated in compose-spec/compose-spec#298 (comment) that the use-case for
dockerfile_inline
would be for simple commands, so I think it doesn't hurt to explicitly mention this in the documentation.Location
https://docs.docker.com/compose/compose-file/build/#dockerfile_inline
Suggestion
Add a note to the
dockerfile_inline
section explicitly stating that it's use-case is for simple instructions only and that it cannot fully replace using a separate Dockerfile.The text was updated successfully, but these errors were encountered: