Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't cache layers with docker-compose #1026

Open
1 of 5 tasks
ldanielw1 opened this issue May 9, 2024 · 0 comments
Open
1 of 5 tasks

Can't cache layers with docker-compose #1026

ldanielw1 opened this issue May 9, 2024 · 0 comments

Comments

@ldanielw1
Copy link

ldanielw1 commented May 9, 2024

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)
  • 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 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant