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

Permission denied through skaffold #1470

Open
cabrinoob opened this issue Jan 15, 2019 · 9 comments

Comments

Projects
None yet
8 participants
@cabrinoob
Copy link

commented Jan 15, 2019

Hi, I'am using the version 0.20.0.

I have a strange behavior with the build stage. Here is my Dockerfile :

FROM node as build

COPY package.json package.json
RUN npm install
COPY . .
RUN npm run tsc

FROM node:alpine
COPY --from=build ./dist .
COPY package.json package.json
RUN npm install --prod
CMD ["node","index.js"]

When I build this Dockerfile using my local Docker, it works without any problem.
But, If I launch a skaffold dev the build fails with this error :

Step 5/10 : RUN npm run tsc
 ---> Running in 0c947ae2b542

> servicets@1.0.0 tsc /
> ./node_modules/typescript/bin/tsc

sh: 1: ./node_modules/typescript/bin/tsc: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! servicets@1.0.0 tsc: `./node_modules/typescript/bin/tsc`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the servicets@1.0.0 tsc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-01-15T13_37_07_099Z-debug.log

I have a permission denied through Skaffold that I don't have through my local docker.

The only workarround I have found is to add

 RUN chmod a+x ./node_modules/typescript/bin/tsc

Just before RUN npm run tsc

I don't understand why I have these different behaviors

Thank you

@dgageot dgageot self-assigned this Jan 18, 2019

@dgageot

This comment has been minimized.

Copy link
Member

commented Jan 18, 2019

Hi @cabrinoob on which OS do you see this happening?

@cabrinoob

This comment has been minimized.

Copy link
Author

commented Jan 18, 2019

@dgageot : Oh sorry, I missed that : Windows 10

@dgageot

This comment has been minimized.

Copy link
Member

commented Jan 18, 2019

I have the feeling that it's related. Docker and file permissions has always been complicated. I'm gonna have to try and reproduce that on a windows machine.

@jeffshadap

This comment has been minimized.

Copy link

commented Feb 25, 2019

I'm having the same problem on Windows 10

@dgageot dgageot removed their assignment Apr 8, 2019

@kryptt

This comment has been minimized.

Copy link

commented Jun 3, 2019

Same problem here on Windows 10...

@cabrinoob

This comment has been minimized.

Copy link
Author

commented Jun 7, 2019

I resolved my problem! I switched to Ubuntu :trollface:

@JavierGlzFdz

This comment has been minimized.

Copy link

commented Jun 14, 2019

same error here

or this probably going to be fix or should we try to find another solution?

@nkubala

This comment has been minimized.

Copy link
Member

commented Jun 19, 2019

unfortunately I don't think anyone on our team has been able to reproduce this one yet. any help digging into this one further and coming up with a fix would be greatly appreciated, we'd love to get it fixed but not sure we'll be able to prioritize this at the moment.

@William-Yeh

This comment has been minimized.

Copy link

commented Jun 25, 2019

I also encounter this issue, and write an article to re-produce it:
https://william-yeh.net/post/2019/06/docker-file-permissions/

@balopat balopat added the help wanted label Jul 2, 2019

@dgageot dgageot self-assigned this Jul 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.