Skip to content

Error in dockerfile: REGISTRY_DOMAIN, NPM_TOKEN etc are not set properly #17

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

Open
antoine-sac opened this issue Jun 2, 2023 · 0 comments

Comments

@antoine-sac
Copy link

There is a silent error in the dockerfile. It does not prevent the build but it's a bug for anyone relying on the behaviour to set a custom REGISTRY_DOMAIN.

The line in question is:

RUN if [[ -z "$NPM_SCOPE" && -z "$NPM_TOKEN" && -z "$REGISTRY_DOMAIN" ]]; \
    then \
    echo -e "//$REGISTRY_DOMAIN/:_authToken=$NPM_TOKEN\\n$NPM_SCOPE:registry=https://$REGISTRY_DOMAIN/" > .npmrc ; \
    fi

When building, this line fails, so effectively the build args REGISTRY_DOMAIN, NPM_TOKEN and NPM_SCOPE are ignored.

Build logs (cf step 15):

Step 14/17 : ARG REGISTRY_DOMAIN
 ---> Running in 4881[96](https://github.com/hestiia-engineering/ecommerce-backend-sanity/actions/runs/5156608732/jobs/9287830414#step:2:96)cf5011
Removing intermediate container 488196cf5011
 ---> 2eafbc358259
Step 15/17 : RUN if [[ -z "$NPM_SCOPE" && -z "$NPM_TOKEN" && -z "$REGISTRY_DOMAIN" ]];     then     echo -e "//$REGISTRY_DOMAIN/:_authToken=$NPM_TOKEN\\n$NPM_SCOPE:registry=https://$REGISTRY_DOMAIN/" > .npmrc ;     fi
 ---> Running in 79ee42191fbf
/bin/sh: 1: [[: not found
Removing intermediate container 79ee42191fbf
 ---> 38c5e1d5eb88
Step 16/17 : COPY entrypoint.sh /entrypoint.sh
 ---> 9292bab8fc07
Step 17/17 : ENTRYPOINT ["/entrypoint.sh"]
 ---> Running in 696606a6dd73
Removing intermediate container 696606a6dd73
 ---> 4c5ebde6d258
Successfully built 4c5ebde6d258
Successfully tagged ed866e:a4e41192dabf4b21b910df695459aeac
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

1 participant