ERROR [build 2/1] ADD public/ /pub
First time using gatsby-docker it just crashes by following your readme. What am I missing here?
[+] Building 3.0s (9/10)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 527B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for docker.io/gatsbyjs/gatsby:latest 2.9s
=> [internal] load metadata for docker.io/gatsbyjs/gatsby:onbuild 2.8s
=> [auth] gatsbyjs/gatsby:pull token for registry-1.docker.io 0.0s
=> [stage-1 1/2] FROM docker.io/gatsbyjs/gatsby@sha256:fa8b71211a1ae2d3a3f53c1a8c73cd6aa563b02e5c7d2e70975fed65e55af712 0.0s
=> => resolve docker.io/gatsbyjs/gatsby@sha256:fa8b71211a1ae2d3a3f53c1a8c73cd6aa563b02e5c7d2e70975fed65e55af712 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 2B 0.0s
=> CANCELED [build 1/1] FROM docker.io/gatsbyjs/gatsby:onbuild@sha256:cc6f390975708bee5b4dc9a2a4812b8e8bfb2ded1bb5c3107be91150e97ccb50 0.0s
=> => resolve docker.io/gatsbyjs/gatsby:onbuild@sha256:cc6f390975708bee5b4dc9a2a4812b8e8bfb2ded1bb5c3107be91150e97ccb50 0.0s
=> => sha256:cc6f390975708bee5b4dc9a2a4812b8e8bfb2ded1bb5c3107be91150e97ccb50 947B / 947B 0.0s
=> => sha256:d584dc12fdde1770d771137dfecff12d53ae522fadd6ae7915c08864d6401dd7 3.32kB / 3.32kB 0.0s
=> ERROR [build 2/1] ADD public/ /pub``
`
I was able to get it working by replacing
COPY --from=build /app/public /pub
with
COPY --from=build /pub /pub
I just dug through the content of the generated onbuild container and saw that there was no /app/public folder but there was a /pub folder with all my gatsby site files in it. Not sure if this is the right answer but it appears to be working for me.
I think the problem comes from here, there is a difference between the image in the docker hub and the Dockerfile on the git repo.
seems like the docker image is 2 years old - are there any updates planned?