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

Production docker builds are broken due to some change in the Dockerfile #691

Closed
janus-reith opened this issue Jun 29, 2020 · 2 comments · Fixed by #693
Closed

Production docker builds are broken due to some change in the Dockerfile #691

janus-reith opened this issue Jun 29, 2020 · 2 comments · Fixed by #693
Assignees
Labels
bug For issues that describe a defect or regression in the released software priority high

Comments

@janus-reith
Copy link
Collaborator

Type: major

Describe the bug
This commit: ddc3ae0 broke the docker build of the new storefront by putting everything into quotes and thereby exporting a string instead of exporting env vars and running next build.

@mikemurray I only found this commit when investigating how this was introduced, but not a PR this belongs to.

To Reproduce
Run a docker build, notice that the actual build step finished immediately.

@janus-reith janus-reith changed the title Production docker builds are broken due to linted Dockerfile Production docker builds are broken due to some change Dockerfile Jun 29, 2020
@janus-reith janus-reith changed the title Production docker builds are broken due to some change Dockerfile Production docker builds are broken due to some change in the Dockerfile Jun 29, 2020
@focusaurus focusaurus added bug For issues that describe a defect or regression in the released software priority high labels Jun 29, 2020
@mikemurray
Copy link
Member

@janus-reith I see.. I suppose the solution to try would be to revert it and a hadolint ignore for that line so it doesn't complain.

@janus-reith
Copy link
Collaborator Author

@mikemurray Yes sounds good, although I would also be fine with a different syntax for this if there is any for this that would pass hadolint, or some other way to use env vars in general.
It actually took me some trial and error aswell to find out what to put in curly braces here, I didn't actually believe this one with the nested ${} to be the correct approach but had tried others that didn't work.

To give some background:
The current solution is just something I came up with after fiddling around with the Docker and nextjs builds for a longer time to be able to create different builds with separated environments from one codebase, as the env needs to be present at build time now.
Somehow I found no more generic solution for this, except for manually passing all the args to the build separately, then passing them forward in the dockerfile, which seemed really unintuitive.
That's why I chose NEXTJS_DOTENV as the only env var that needs to be passed(defaults to "prod" as fallback), which then points to the actual file with the relevant env vars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For issues that describe a defect or regression in the released software priority high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants