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

When using the 0.140.2-onbuild image, the nginx start screen is displayed #198

Closed
masutaka opened this issue Jan 5, 2025 · 2 comments
Closed

Comments

@masutaka
Copy link

masutaka commented Jan 5, 2025

Describe the bug

When starting a Docker image built with Cloud Build on Cloud Run, the nginx start screen is displayed.

Welcome to nginx!

To Reproduce

The issue can also be reproduced on macOS (Sequoia) by setting DOCKER_BUILDKIT=0.

Dockerfile:

FROM floryn90/hugo:0.140.2-onbuild AS hugo

FROM nginx
COPY --from=hugo /target /usr/share/nginx/html

The HTML files that Hugo generates are not copied to /usr/share/nginx/html.

# Build the Docker image in Hugo project
$ DOCKER_BUILDKIT=0 docker build . -t masutaka/hugo:0.140.2-onbuild

$ docker run --rm --entrypoint sh -it masutaka/hugo:0.140.2-onbuild

$ ls -alF /usr/share/nginx/html
total 16
drwxr-xr-x 1 root root 4096 Jan  5 10:39 ./
drwxr-xr-x 1 root root 4096 Dec 24 23:02 ../
-rw-r--r-- 1 root root  497 Nov 26 15:55 50x.html
-rw-r--r-- 1 root root  615 Nov 26 15:55 index.html
  • The issue does not occur with 0.138.0-onbuild.
  • The issue occurs with 0.140.1-onbuild and 0.140.2-onbuild.

Additional context

It seems the fix for the permission error I pointed out in #194 was incomplete.

@floryn90
Copy link
Owner

floryn90 commented Jan 5, 2025

hi @masutaka,

You have to use DOCKER_BUILDKIT=1 if you want to use the Docker's multi-stage builds: https://docs.docker.com/build/building/multi-stage/

Closing the issue since it's not related to the Hugo's image

@floryn90 floryn90 closed this as completed Jan 5, 2025
@masutaka
Copy link
Author

masutaka commented Jan 6, 2025

I see. Why was multi-stage build enabled in Cloud Build up until 0.138.0-onbuild, but disabled in 0.140.2-onbuild?
I'll look into it. Thank you.

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

2 participants