-
Notifications
You must be signed in to change notification settings - Fork 587
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
Docker Build Error ARG or ENV missing during build process NEXT_PUBLIC_SALEOR_API_URL #1067
Comments
I have also tried to build this on my local Mac mini M2 and the build command will not run getting the same error as hub.docker.com even with the env variable set before running. It will work however if I run 'docker compose up' command. export NEXT_PUBLIC_SALEOR_API_URL=http://localhost:8000/graphql/ => ERROR [builder 6/6] RUN pnpm build 1.5s
Dockerfile:3735 | RUN yarn global add pnpm@$PNPM_VERSION
|
I've submitted a pull request (#1069) that addresses the issue reported. This pull request aims to resolve the problem related to building the Docker image using Docker Compose. These simple steps are enough to run the application in the basic version: |
Let me know what stage you are at. |
Summary
I have followed the directions: cloned the repo, cp .env.example to .env, I have run pnpm i. When I create a docker image of this repo it fails with the same reason/text/error above from original poster. I saw also that the .env file was being ignored by the .gitignore file and even changing this does not fix it. It has been 3 years since I worked with a saleor store and I am not sure what I could be doing wrong since the directions seem simple enough to follow. I have used this process for Saleor and Dashboard and they create the docker images without any errors.
2024-01-10T16:04:12Z > [builder 6/6] RUN pnpm build:
2024-01-10T16:04:12Z #22 1.681 > pnpm run generate
2024-01-10T16:04:12Z #22 1.681
2024-01-10T16:04:12Z #22 2.895
2024-01-10T16:04:12Z #22 2.895 > [email protected] generate /app
2024-01-10T16:04:12Z #22 2.895 > graphql-codegen --config .graphqlrc.ts
2024-01-10T16:04:12Z #22 2.895
2024-01-10T16:04:12Z #22 5.155 Before GraphQL types can be generated, you need to set NEXT_PUBLIC_SALEOR_API_URL environment variable.
2024-01-10T16:04:12Z #22 5.157 Follow development instructions in the README.md file.
2024-01-10T16:04:12Z #22 5.223 ELIFECYCLE Command failed with exit code 1.
2024-01-10T16:04:12Z #22 5.246 ELIFECYCLE Command failed with exit code 1.
2024-01-10T16:04:12Z ------
2024-01-10T16:04:12Z ERROR: failed to solve: executor failed running [/bin/sh -c pnpm build]: exit code: 1
2024-01-10T16:04:12Z Build failed using Buildkit (1)
I have this being built within the hub.docker system straight from my GitHub repo.
I have even specified these in the build variables section of the hub.docker system and the build still fails. I don't understand why the other 2 images (Saleor 3.18 and Dashboard 3.18) will build correctly but this one does not.This repo will however work if I use 'docker compose up' from my local computer m2 Mac.
Steps to reproduce
2024-01-10T23:53:14Z > [builder 6/6] RUN pnpm build:
2024-01-10T23:53:14Z #22 1.761 > pnpm run generate
2024-01-10T23:53:14Z #22 1.761
2024-01-10T23:53:14Z #22 2.992
2024-01-10T23:53:14Z #22 2.992 > [email protected] generate /app
2024-01-10T23:53:14Z #22 2.992 > graphql-codegen --config .graphqlrc.ts
2024-01-10T23:53:14Z #22 2.992
2024-01-10T23:53:14Z #22 5.275 Before GraphQL types can be generated, you need to set NEXT_PUBLIC_SALEOR_API_URL environment variable.
2024-01-10T23:53:14Z #22 5.277 Follow development instructions in the README.md file.
2024-01-10T23:53:14Z #22 5.343 ELIFECYCLE Command failed with exit code 1.
2024-01-10T23:53:14Z #22 5.370 ELIFECYCLE Command failed with exit code 1.
2024-01-10T23:53:14Z ------
2024-01-10T23:53:14Z ERROR: failed to solve: executor failed running [/bin/sh -c pnpm build]: exit code: 1
2024-01-10T23:53:14Z Build failed using Buildkit (1)
A link to a reproduction repository
https://github.com/jdmueller/AdventureStorefront
Output from envinfo
No response
The text was updated successfully, but these errors were encountered: