Docker /docker-entrypoint.sh: 32: exec: yarn: not found when running docker container (Angular)

Discussão em 'Angular' iniciado por teachMe, Outubro 15, 2024.

  1. teachMe

    teachMe Guest

    I am trying to build an angular app in a docker container. I successfully built a docker image and created a container from it, however when I run it I get /docker-entrypoint.sh: 32: exec: yarn: not found. Here is my Dockerfile:

    FROM node:13.3.0 AS compile-image
    RUN npm install -g yarn
    WORKDIR /opt/ng
    COPY package.json yarn.lock angular.json ./
    RUN yarn
    RUN yarn install
    COPY . ./
    RUN node_modules/.bin/ng build --prod
    FROM nginx
    COPY --from=compile-image /opt/ng/dist/dashboard /usr/share/nginx/html
    CMD ["yarn", "start"]


    From what I understand Run yarn fails but I am confused as to why since RUN npm install -g yarn should install it. I am new to docker so sorry if I am jumping to wrong conclusions.

    Continue reading...

Compartilhe esta Página