abiosoft / abiosoft/colima

Can't cache layers with docker-compose

Aperta
#1,026 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
30.8k
Fork
613
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Description

On a installation of colima with docker + docker-compose on an m1 mac. It's strange that I can run `docker build .` and the layers will cache... but then when I run `docker-compose build`... the layers don't (and they wipe out any layers cached by the previous call to `docker build`. All of this is done without changing the local files at all.

I also noticed that every time I run docker-compose build, the number of layers is increasing in my colima machine's /var/lib/docker/overlay2. So I'm guessing it just can't find the cached layers and is continuing to create new layers in that folder?

At this point, I honestly can't tell if this is a docker-compose bug or a colima bug... though I never experienced this when I was on Docker Desktop.

here's my docker-compose.yml file:
```
services:
db:
build: { context: ., dockerfile: ./Dockerfile }
container_name: db
env_file: [ .env ]
ports: ["$DB_PORT:$DB_PORT"]
volumes:
- $DB_MOUNT:/opt/prod/db/data
- $DB_CONF_MOUNT:/opt/prod/db/conf/mariadb/server
- $DB_SECRETS_MOUNT:/opt/prod/db/secrets
- $DB_SSL_PUBLIC_MOUNT:/opt/prod/db/conf/mariadb/ssl_public
- $DB_SSL_MOUNT:/opt/prod/db/conf/mariadb/ssl
networks: [ container-network ]
user: "${CONTAINER_UID}:myuser"
logging: { driver: "json-file", options: { max-size: "10m", max-file: "10" } }
security_opt:
- no-new-privileges:true
userns_mode: keep-id:uid=${CONTAINER_UID}

networks:
container-network:
name: my-container-network
```

### Version

colima 0.6.8
docker 26.1.1
docker-compose 2.27.0

### Operating System

- [ ] macOS Intel <= 13 (Ventura)
- [ ] macOS Intel >= 14 (Sonoma)
- [ ] Apple Silicon <= 13 (Ventura)
- [x] Apple Silicon >= 14 (Sonoma)
- [ ] Linux

### Output of `colima status`

```
INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0001] socket: unix:///Users/dwu/.colima/default/docker.sock
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.