$ gcloud builds submit --tag gcr.io/projectname/testserver
// ... works fine until the COPY step:
Step 6/7 : COPY build ./
COPY failed: stat /var/lib/docker/tmp/docker-builder653325957/build: no such file or directory
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1
That build folder listed above, /var/lib/docker/tmp/docker-builder653325957/build
, is not a local folder. Does Cloud Builder create a temp folder in that format?
How do I get it to copy my local build
folder?
I also tried COPY ./build ./
but the CLI output was the same
Dockerfile below.
FROM node:12-slim
# Create app folder
WORKDIR /usr/src/app
# Install app deps. Copy the lock file
COPY package*.json ./
RUN npm install
ENV SCOPES=removed \
SHOPIFY_API_KEY=removed \
SHOPIFY_API_SECRET=removed \
CLIENT_APP_URL=removed
COPY build ./
CMD ["node", "server.js"]
The gcloud
command uses the .gitignore
and .gcloudignore
files to determine which files and directories to include with the Docker build. If your build
directory is listed in either of these files, it won't be available to copy into your container image.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With