Docker Community Forums

Share and learn in the Docker community.

Compose create alot of data multiple times

Hey my friends, i have this compose but generate a lot of trash, its like a multiple notag images. but, i cant deleted becaus are child from my web container. Any advice. grats!!

pd: if i use this copmand i destroy all web with their trash images:

docker rmi $(docker images -a -q) -f

docker-compose file:

version: “3.7”
services:
web:
container_name: checkbarapp
restart: always
image: checkbarapp:1.0.0
build: .
ports:
- “3000:3000”
links:
- mongo
volumes:
- .:/home/checkbar/app
mongo:
container_name: mongodatabase
image: mongo
ports:
- “27017:27017”

this is my docker file:

FROM node:10
RUN mkdir -p /home/checkbar/app
WORKDIR /home/checkbar/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD [“npm”, “run”, “dev”]

Results: docker images -a

REPOSITORY TAG IMAGE ID CREATED SIZE
d98754ad6aff 4 minutes ago 1.15GB
checkbarapp 1.0.0 4e0d26f201f0 4 minutes ago 1.15GB
e30f48778b73 4 minutes ago 1.15GB
2a30179524be 4 minutes ago 1.12GB
7c47bf93d9a4 5 minutes ago 910MB
f24306dcb2a8 5 minutes ago 910MB
0f8ef74bcd76 5 minutes ago 910MB
node 10 0b2b64917e54 33 hours ago 910MB
mongo latest ca8e14b1fda6 7 days ago 493MB