My pipeline looks like this
pipeline:
build:
image: node:alpine
secrets: [ private_key ]
commands:
- mkdir /root/.ssh && echo "$PRIVATE_KEY" > /root/.ssh/id_rsa && chmod 0600 /root/.ssh/id_rsa
- ssh-keyscan -H github.com >> /root/.ssh/known_hosts
- yarn install
ls:
image: alpine:edge
commands:
- ls -la
- ls -la node_modules
harbor:
image: plugins/docker
repo: harbor.***/library/***
secrets: [ docker_username, docker_password ]
registry: harbor.***
tags: ${DRONE_BRANCH/\//-}
And there is Dockerfile
FROM node:alpine
RUN mkdir /app
COPY . /app
RUN ls -la /app
RUN ls -la /app/node_modules
CMD [ "node", "index.js" ]
Problem is: In ls stage i see that all assets generated by build stage (yarn install
) are in place. But in harbor stage when i COPY project files into container ls -la
says that there is no node_modules at all, like it was cloned just now.