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

Publish diagnostic that warns about a duplicate build stage name #133

Closed
rcjsuen opened this issue Aug 5, 2017 · 1 comment
Closed

Publish diagnostic that warns about a duplicate build stage name #133

rcjsuen opened this issue Aug 5, 2017 · 1 comment
Assignees

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Aug 5, 2017

If a build stage name is reused in a Dockerfile, the Docker engine will create an error about this. We should publish a diagnostic for this same error.

FROM alpine AS setup
EXPOSE 8080
FROM alpine AS setup
EXPOSE 8081
$ docker build .
Sending build context to Docker daemon  86.15MB
Step 1/4 : FROM alpine AS setup
 ---> 7328f6f8b418
Step 2/4 : EXPOSE 8080
 ---> Running in ff3ae57dd33a
 ---> f2a118dba9f0
Removing intermediate container ff3ae57dd33a
Step 3/4 : FROM alpine AS setup
duplicate name setup
@rcjsuen
Copy link
Owner Author

rcjsuen commented Aug 8, 2017

Build stage names appear to be case-insensitive.

FROM alpine as setUP
FROM alpine as setup
$ docker build .
Sending build context to Docker daemon  86.15MB
Step 1/2 : FROM alpine as setUP
latest: Pulling from library/alpine
88286f41530e: Pull complete
Digest: sha256:1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe
Status: Downloaded newer image for alpine:latest
 ---> 7328f6f8b418
Step 2/2 : FROM alpine as setup
duplicate name setup

Also note that the name in the error is written in lowercase even though the first build stage that was declared had uppercase characters in it.

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

No branches or pull requests

1 participant