0

here is my .drone.yml:

pipeline:
  test:
  image: node:10
  commands:
    - npm install --production
    - npm run build --production

publish:
  image: plugins/docker
  repo: myhub/image_name
    when:
      event: push
      branch: master

the command npm run build creates a folder named build with static files inside. However, the publish step fails when building the docker image. Here is my Dockerfile:

FROM node:10-alpine

RUN mkdir -p /app
WORKDIR /app

COPY build build

The error being: COPY failed: stat /var/lib/docker/tmp/docker-builder090186817/build: no such file or directory time="2018-05-28T21:19:25Z" level=fatal msg="exit status 1"

So I don't quite understand how to build some files in one step, and copy them in the docker publish step...

Thanks for your help!

Sulliwane
  • 410
  • 6
  • 16

1 Answers1

0

So anything in the workspace will get shared to the next step ;)

Are you able to build the docker image without drone with just docker build .?

ie. You might want to try to change COPY build build to be COPY ./build /app/build or the something like it.

Joachim
  • 2,761
  • 1
  • 15
  • 7