I’m using multistage build in docker. I’m using Jenkins to build the image in my CI process. I’m able to build the image completely fine on my local. But when I’m trying to build it, its showing me an error:
Step 1/11 : FROM node:8.1.4-alpine as builder
Error parsing reference: "node:8.1.4-alpine as builder" is not a valid repository/tag: invalid reference format
All my single builds work perfectly fine, I think its something to do with the multistage build.
Here’s my docker file:
### STAGE 1: Build ###
# We label our stage as ‘builder’
FROM node:8.1.4-alpine as builder
COPY package.json ./
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build
RUN npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app
WORKDIR /ng-app
COPY . .
## Build the angular app in production mode and store the artifacts in dist folder
RUN $(npm bin)/ng build --prod
### STAGE 2: Setup ###
FROM nginx:1.13.3-alpine
## Copy our default nginx config
COPY nginx/default.conf /etc/nginx/conf.d/
## Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
## From ‘builder’ stage copy over the artifacts in dist folder to default nginx public folder
COPY --from=builder /ng-app/dist /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
I'm using the the following jenkins version: `jenkins/jenkins:2.95``
Any help would be appreciated.