-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 compose run --entrypoint error: usr/local/bin/npm: npm: line 2: syntax error near unexpected token `;' #9483
Comments
According to documentation See following minimal working example :
|
Hey @maxcleme thanks for your help, I actually tried that but it doesn't work for me. It fails if I do a
That's why I am using a secret under the build section following this implementation: #9386 |
Ok just to be sure to understand the whole context:
So if Can you share with us the output of:
|
That's correct about the versions, I forgot to mention that
|
Ok fine, so your error is related to the fact that you're trying to ask We can expect that Can you also share your Dockerfile (remove the critical part if needed)? |
The entrypoint in the Dockerfile is a script:
Running the command
|
So you don't want to use |
I do want to use By the way, And also, reading the documentation, should I execute it like this?
It gives me the |
Ok my bad I did a mix between Yes you're inside your container We usually use |
So, just to be clear. Is this:
The replacement of:
If so, I can go ahead and close the issue. Also, thanks for the explanation about Edit: But it would have been great to know what the reason was for the error when running |
Yep this command open a bash session in your container Honestly did know why the command with the |
Ok I managed to reproduce it, so the issue is the usage of the So to be able to run your
|
First of all, thank you very much for taking the time to look into this. Great to know how to solve this. I think I can go ahead and put the But will Like:
I mean, I just added the changes you mentioned to my compose file (removed the command from the app service) and also to the Dockerfile (added the CMD at the end of the file), and everything's working fine but it doesn't hurt to ask. One last question, do you know why the |
Description
I'm basically getting an npm error on compose v2 but works on compose v1. I recently updated from v1 in order to use the compose v2 secrets syntax. But while I was testing to see if everything was working correctly, this command failed:
And, of course, it failed because I'm using v2 now, so I ran, without success, the new syntax:
Results:
What's the error here? I didn't change anything except the version of my docker-compose file and using the new property
secrets
.Basically, what I usually get, using v1, is this:
docker-compose.yml
file if needed:Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker compose version
:Output of
docker info
:Additional environment details:
The text was updated successfully, but these errors were encountered: