I have an Nx Monorepo that containing several NestJS APIs. I am trying to push a Docker image of just one of these APIs to the GitLab Container Registry, but keeps failing on what appears to be a timeout.
This is a simple look at my project structure:
monorepo
–package.json
–apps
—-app-api
——Dockerfile
Here is my Dockerfile for the app-api
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
EXPOSE 4002
CMD ["npm", "run", "start:app-api"]
I build the image locally with
docker build -t registry.gitlab.com/<group>/<project>/app-api -f apps/app-api/Dockerfile .
This is successful. However, when I then try to push to the GitLab Container Registry:
docker push registry.gitlab.com/<group>/<project>/app-api
I get the following error output:
Using default tag: latest
The push refers to repository [registry.gitlab.com/<group>/<project>/app-api]
c4b377e26346: Pushing [==================================================>] 2.276GB/2.276GB
a6ddf7465691: Layer already exists
971cfc403c58: Layer already exists
9c2c8f3cfe79: Layer already exists
3fecce352908: Layer already exists
1da03ac21ec8: Layer already exists
926b35a05f1d: Layer already exists
d4fc045c9e3a: Layer already exists
use of closed network connection
I can then see the image in my container registry in GitLab, but it has 0 tags and display “This image has no active tags.
The last tag related to this image was recently removed. This empty image and any associated data will be automatically removed as part of the regular Garbage Collection process. If you have any questions, contact your administrator.”
Andres Paredes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.