1

I try to make a simple docker container based on official node image, but when I try to run any npm script inside of the container all I get is sh: 1: ts-node: Permission denied. The problem only occurs on Windows (with enabled WSL integration), the same image works on native Linux. I tried Debian and openSUSE.

I installed Docker Desktop, WSL distro (first Debian, but when it didn't worked I moved to openSUSE as it's not debian based but same result), set this distro to default with wsl --set-default <name>, enabled WSL integration in Docker Desktop settings, checked my distro. I made this simple Dockerfile:

FROM node

WORKDIR /srv/app

COPY ["package.json", "package-lock.json", "./"]

RUN npm install

COPY . .

CMD ["npm", "start"]

my start script is just ts-node src/app.ts but the result is the same regardless of what script I try to run.

And when I try to run the image

docker build -t sof .
docker run sof

I get:

> app@1.0.0 start
> ts-node src/app.ts

sh: 1: ts-node: Permission denied
ACiep
  • 11
  • 1
  • Does this answer your question? [sh: 1: node: Permission denied](https://stackoverflow.com/questions/51811564/sh-1-node-permission-denied) – ayrusme Jun 07 '23 at 21:46

0 Answers0