Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Staticfile 0.0.12 and Nginx 0.0.196 don't seem to work #78

Open
dmikusa opened this issue Jan 25, 2021 · 2 comments
Open

Staticfile 0.0.12 and Nginx 0.0.196 don't seem to work #78

dmikusa opened this issue Jan 25, 2021 · 2 comments

Comments

@dmikusa
Copy link

dmikusa commented Jan 25, 2021

pack build -b https://github.com/paketo-buildpacks/nginx/releases/download/v0.0.196/nginx-0.0.196.cnb -b https://github.com/paketo-community/staticfile/releases/download/v0.0.12/staticfile-0.0.12.cnb nginx_helloworld
base: Pulling from paketobuildpacks/builder
Digest: sha256:7fffe76d47effd9affe52089427325819c31e852a646df56c77e6d05c0bc8f66
Status: Image is up to date for paketobuildpacks/builder:base
base-cnb: Pulling from paketobuildpacks/run
Digest: sha256:f084de391a20a9cd1521a9fbeffe782f210fd014d4557eb3cc3bfd56cade69fb
Status: Image is up to date for paketobuildpacks/run:base-cnb
0.10.1: Pulling from buildpacksio/lifecycle
Digest: sha256:37bf981c31303cc022f9f37e079ecd571618a574177dcf2d2b0b19dcb4382c30
Status: Image is up to date for buildpacksio/lifecycle:0.10.1
===> DETECTING
[detector] paketo-buildpacks/nginx     0.0.196
[detector] paketo-community/staticfile 0.0.12
===> ANALYZING
[analyzer] Previous image with name "nginx_helloworld" not found
===> RESTORING
===> BUILDING
[builder] Paketo Nginx Server Buildpack 0.0.196
[builder]   Resolving Nginx Server version
[builder]     Candidate version sources (in priority order):
[builder]       <unknown> -> "*"
[builder]
[builder]     Selected Nginx Server version (using <unknown>): 1.19.6
[builder]
[builder]   Executing build process
[builder]     Installing Nginx Server 1.19.6
[builder]       Completed in 721ms
[builder]
[builder]   Configuring environment
[builder]     PATH -> "$PATH:/layers/paketo-buildpacks_nginx/nginx/sbin"
[builder]         Writing profile.d/configure.sh
[builder]       Calls executable that parses templates in nginx conf
[builder] Staticfile Buildpack 0.0.12
[builder]   Parsing buildpack.yml for nginx config
[builder]   Writing profile.d scripts
[builder]   Executing build process
[builder]     Filling out nginx.conf template
[builder]       Completed in 1ms
[builder]
[builder]   Configuring environment
[builder]     APP_ROOT -> "/workspace"
[builder]
===> EXPORTING
[exporter] Adding layer 'paketo-community/staticfile:staticfile'
[exporter] Adding 1/1 app layer(s)
[exporter] Adding layer 'launcher'
[exporter] Adding layer 'config'
[exporter] Adding layer 'process-types'
[exporter] Adding label 'io.buildpacks.lifecycle.metadata'
[exporter] Adding label 'io.buildpacks.build.metadata'
[exporter] Adding label 'io.buildpacks.project.metadata'
[exporter] Setting default process type 'web'
[exporter] *** Images (cd74a68ef3a4):
[exporter]       nginx_helloworld
Successfully built image nginx_helloworld

Note how there is no Nginx layer exported.

If I downgrade to Nginx 0.0.195, it works fine.

 pack build -b https://github.com/paketo-buildpacks/nginx/releases/download/v0.0.195/nginx-0.0.195.cnb -b https://github.com/paketo-community/staticfile/releases/download/v0.0.12/staticfile-0.0.12.cnb nginx_helloworld
base: Pulling from paketobuildpacks/builder
Digest: sha256:7fffe76d47effd9affe52089427325819c31e852a646df56c77e6d05c0bc8f66
Status: Image is up to date for paketobuildpacks/builder:base
base-cnb: Pulling from paketobuildpacks/run
Digest: sha256:f084de391a20a9cd1521a9fbeffe782f210fd014d4557eb3cc3bfd56cade69fb
Status: Image is up to date for paketobuildpacks/run:base-cnb
0.10.1: Pulling from buildpacksio/lifecycle
Digest: sha256:37bf981c31303cc022f9f37e079ecd571618a574177dcf2d2b0b19dcb4382c30
Status: Image is up to date for buildpacksio/lifecycle:0.10.1
===> DETECTING
[detector] paketo-buildpacks/nginx     0.0.195
[detector] paketo-community/staticfile 0.0.12
===> ANALYZING
[analyzer] Restoring metadata for "paketo-community/staticfile:staticfile" from app image
===> RESTORING
===> BUILDING
[builder] Paketo Nginx Server Buildpack 0.0.195
[builder]   Resolving Nginx Server version
[builder]     Candidate version sources (in priority order):
[builder]       <unknown> -> "*"
[builder]
[builder]     Selected Nginx Server version (using <unknown>): 1.19.6
[builder]
[builder]   Executing build process
[builder]     Installing Nginx Server 1.19.6
[builder]       Completed in 826ms
[builder]
[builder]   Configuring environment
[builder]     PATH -> "$PATH:/layers/paketo-buildpacks_nginx/nginx/sbin"
[builder]         Writing profile.d/configure.sh
[builder]       Calls executable that parses templates in nginx conf
[builder] Staticfile Buildpack 0.0.12
[builder]   Parsing buildpack.yml for nginx config
[builder]   Writing profile.d scripts
[builder]   Executing build process
[builder]     Filling out nginx.conf template
[builder]       Completed in 0s
[builder]
[builder]   Configuring environment
[builder]     APP_ROOT -> "/workspace"
[builder]
===> EXPORTING
[exporter] Adding layer 'paketo-buildpacks/nginx:nginx'
[exporter] Reusing layer 'paketo-community/staticfile:staticfile'
[exporter] Reusing 1/1 app layer(s)
[exporter] Reusing layer 'launcher'
[exporter] Adding layer 'config'
[exporter] Reusing layer 'process-types'
[exporter] Adding label 'io.buildpacks.lifecycle.metadata'
[exporter] Adding label 'io.buildpacks.build.metadata'
[exporter] Adding label 'io.buildpacks.project.metadata'
[exporter] Setting default process type 'web'
[exporter] *** Images (9887a191668e):
[exporter]       nginx_helloworld
Successfully built image nginx_helloworld

Now an Nginx layer is exported.

This doesn't seem to be an issue when just using the Nginx buildpack by itself. I can use 0.0.196 and it works fine. It seems to be just in conjunction with Staticfile. Interestingly, when I run the integration tests for staticfile this doesn't happen either. The integration tests run fine and don't reproduce this problem.

I didn't look into it more, but this change seems like it could be what's causing the change in behavior: paketo-buildpacks/nginx@3648f33.

@arjun024
Copy link
Member

Thanks for reporting. This happened because we fixed a bug in nginx and staticfile, but hadn't released a version of staticfile. Should be fixed with gcr.io/paketo-community/staticfile:0.0.13 that I just released.

@0xLiang233
Copy link

@arjun024 Thanks, the container can be started successfully. But the readme.md does not contain a container start command, in fact, a port arguments needs to be added. --env PORT=XX

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

No branches or pull requests

3 participants