I have a project that contains a Dockerfile and a docker-compose.yml.
Dockerfile:
FROM mhart/alpine-node:11 AS builder
WORKDIR /app
COPY . .
RUN yarn install
RUN yarn build
WORKDIR /app
COPY --from=builder /app/build .
CMD ["serve", "-p", "80", "-s", "."]
docker-compose.yml:
version: "3"
services:
front:
build: .
ports:
- 8080:80
restart: always
When I try to run it like below.
docker-compose up -d
I get the following message:
Building front
Step 1/8 : FROM mhart/alpine-node:11 AS builder
---> 5ff13b69f215
Step 2/8 : WORKDIR /app
---> Using cache
---> 1da7c0d4dfac
Step 3/8 : COPY . .
---> Using cache
---> 8d82bb9c0ecf
Step 4/8 : RUN yarn install
---> Using cache
---> 1e557a2dbe03
Step 5/8 : RUN yarn build
---> Using cache
---> ea2d3f56ff39
Step 6/8 : WORKDIR /app
---> Using cache
---> 1edb82c45c49
Step 7/8 : COPY --from=builder /app/build .
ERROR: Service 'front' failed to build: invalid from flag value builder: pull access denied for builder, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
I saw another question on Stackoverflow, I think it may be close to my problem.
invalid from flag value build: pull access denied for build, repository does not exist or may require 'docker login'
But I only have a build stage, not two stage like in the question from the link.