0

I have the following Dockerfile:

FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get -y install curl \
    iputils-ping \
    apt-transport-https \
    tar \
    jq \
    python && \
    curl -sL https://deb.nodesource.com/setup_14.x | bash && \
    apt-get install nodejs -yq && \
    apt-get clean && apt-get autoremove

RUN npm install -g npm@latest

ARG GH_RUNNER_VERSION="2.283.3"
WORKDIR /actions-runner
RUN curl -o actions.tar.gz --location "https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSION}/actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz" && \
    tar -zxf actions.tar.gz && \
    rm -f actions.tar.gz && \
    ./bin/installdependencies.sh

COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
ENTRYPOINT ["/actions-runner/entrypoint.sh"]

and the following step on the ci:

- name: Create DB
        run: npm run dc-up

The output of that step is: npm: command not found.

I added the path using the method the docs suggested, it was done by adding a new step:

- name: add npm to path
        run: echo "/usr/bin/npm" >> $GITHUB_PATH

I've checked that node is in the path by printing the path in a separate step inside the CI and the output is:

Run echo "$PATH"
/usr/bin/npm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

I know 100% that NPM is installed into the docker image because when I run it local and only try to interact withit without the ENTRYPOINT then I'm able to print the NPM version and I checked that is it indeed in /usr/bin/npm, but still, inside the steps of the CI it can't find npm for some reason. And its not only for npm, but for every single installation that I tried to do, I just picked npm for showcase.

Anyone has any idea what can be done?

Max
  • 907
  • 2
  • 13
  • 27

0 Answers0