compose icon indicating copy to clipboard operation
compose copied to clipboard

Unsupported option: 'cache_to'

Open rory-lamendola opened this issue 3 years ago • 1 comments

Description

I'm having some issues trying to cache docker layers using cache_to. It appears to be an option in the docker compose file: https://docs.docker.com/compose/compose-file/build/#cache_to but I can't actually find it being released in the version notes: https://docs.docker.com/compose/compose-file/compose-versioning/#version-3

When I try to run docker-compose up with that included, I get

ERROR: The Compose file './docker-compose.yml' is invalid because:
services.test.build contains unsupported option: 'cache_to'

Steps to reproduce the issue: docker-compose.yml

---
version: "3.8"

services:
  test:
    image: "test"
    build:
      context: ..
      dockerfile: "Dockerfile"
      cache_from: 
        - localhost:5000/test:latest
      cache_to: 
        - localhost:5000/test:latest

dockerfile - the contents don't seem to matter, but adding it in case it's relevant

FROM public.ecr.aws/docker/library/python:3.8 AS builder
RUN pip install virtualenv

RUN pip install boto3

Describe the results you received:

ERROR: The Compose file './docker-compose.yml' is invalid because:
services.test.build contains unsupported option: 'cache_to'

Describe the results you expected: I would expect cache_to to be an option given the documentation and push the cache accordingly.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker compose version:

docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.9.0
OpenSSL version: OpenSSL 1.1.1h  22 Sep 2020

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  compose: Docker Compose (Docker Inc., v2.0.0-beta.6)
  scan: Docker Scan (Docker Inc., v0.8.0)

Server:
 Containers: 3
  Running: 2
  Paused: 0
  Stopped: 1
 Images: 18
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc version: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.25-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 11
 Total Memory: 14.16GiB
 Name: docker-desktop
 ID: XGVK:4AEU:ECED:JMW5:OLQV:I6HD:GC7C:KNLZ:ZI5E:L7TY:W7NL:4TCG
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Live Restore Enabled: false```

**Additional environment details:**

rory-lamendola avatar Aug 05 '22 13:08 rory-lamendola

Hello @rory-lamendola Compose v1 is end-of-life, the cache_to attribute was introduced in Compose v2 and won't be backported in Compose v1

glours avatar Aug 05 '22 14:08 glours