compose: [BUG]

Description

Since docker desktop upgrade from 4.26.1 to 4.27 I get “changes out of order errors” when running docker compose build I just expect build to succeed like in older docker desktop version.

Steps To Reproduce

environment:

  • windows 11
  • docker desktop 4.27 with docker compose 2.24
  • wsl integration active

configuration:

docker-compose.yml
version: "3.9"
services:
  app1:
    image: ${BUILD_REGISTRY}/${PROJECT}/${CONTAINER_API_SCRAPER}:${DOCKER_TAG}
    restart: on-failure
    build:
      context: ../
      dockerfile: ./app1/Dockerfile
      args:
        - REGISTRY=${MY_CONTAINER_REPO}
    volumes:
      - ${DOCKER_VOLUMES_DIRECTORY}/config/${CONFIG_SCRAPER}:/config/config.toml

relevant part of dockerfile:

ARG REGISTRY
FROM ${REGISTRY}library/alpine:3.19
ENV PYTHONUNBUFFERED=1
ENV VIRTUAL_ENV=/app/venv
COPY app1/app.py /app/app.py
COPY app1/default.toml app1/requirements.txt /app/
COPY libs /app/libs

run

in app dir run the build command:

C:\Users\tob123\PycharmProjects\project\app1>docker compose build
[+] Building 0.0s (0/0)  docker:default
Building 1.8s (5/8)                                                                                  docker:default
 => [app1 internal] load build definition from Dockerfile                                             0.0s
 => => transferring dockerfile: 1.03kB                                                                             0.0s
 => [app1 internal] load metadata for docker.io/alpine:3.19                1.7s
 => [app1 internal] load .dockerignore                                                                0.0s
 => => transferring context: 2B                                                                                    0.0s
 => ERROR [app1 internal] load build context                                                          0.0s
 => => transferring context: 48B                                                                                   0.0s
 => [app11/4] FROM docker.io/alpine:3.19@sha256:c5b1261d6d3e43071626931f  0.0s
------
 > [app1internal] load build context:
------
failed to solve: changes out of order: "app1/app.py" ""

C:\Users\tob123\PycharmProjects\project\app1>

seems Windows specific issue to me. i could not reproduce the issue using docker compose 2.24 on linux (combined with docker engine 24)

Compose Version

docker compose version
Docker Compose version v2.24.3-desktop.1

note: docker-compose not in use on windows

Docker Environment

docker info
Client:
 Version:    25.0.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1-desktop.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.3-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container. (Docker Inc.)
    Version:  0.0.22
    Path:     C:\Program Files\Docker\cli-plugins\docker-debug.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.21
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.0.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.3.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 1
 Server Version: 25.0.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  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 splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: a1496014c916f9e62104b33d1bb5bd03b0858e59
 runc version: v1.1.11-0-g4bccb38
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.133.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 15.01GiB
 Name: docker-desktop
 ID: 537779bb-df10-4066-a0cf-bb1574e29508
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 32
  • Comments: 40 (1 by maintainers)

Most upvoted comments

Replace the docker-compose.exe with the one from: https://github.com/docker/compose/releases/tag/v2.24.5 (https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-windows-x86_64.exe) in:

C:\Program Files\Docker\cli-plugins
C:\Program Files\Docker\Docker\resources\cli-plugins

@OnkarMuke I received the following email from Docker Support yesterday… We are pleased to inform you that a fix has been developed and is scheduled to be included in the upcoming Docker Desktop release, version 4.27.2. This update is expected to be available by the end of next week.

Had the same problem, but 4.27.2 is now out. Testing…

EDIT: Confirmed working 😃

Any idea when a fix for Docker Desktop will be released?

While waiting for release 4.27.2 you can add an environment variable DOCKER_BUILDKIT with the value 0

Upgraded from 4.26.1 to 4.27 today on Win10. Getting same “changes out of order errors” when running docker.

Same, downgrading docker desktop back to 4.26.1 fixed it for me.

Any idea when a fix for Docker Desktop will be released?

release notes claim that 4.27.1 (released today) includes Docker Engine v25.0.2 but the bundled compose is still out of date.

> docker compose version
Docker Compose version v2.24.3-desktop.1

downgrading docker desktop back to 4.26.1 worked for me too

Facing the same issue on Windows with same docker version.

[core internal] load build context:

failed to solve: changes out of order: “bin/composer_install_all.sh” “”

do we any solution for this issue?

Confirm on Windows 11. After update from 4.27.1 to 4.27.2, bug disappear.

I cant believe i spent hours trying to figure this out and it was not even my fault… Downgrading to 4.26 worked for me to (Intellij Docker Composing)

Same

Experiencing the same issue.

$ docker compose build
failed to solve: changes out of order: "shared/hello.txt" ""
$ docker build . -f foo/Dockerfile
[ Succeeds ]

Here’s the SSCCE as a unified diff:

diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..5c23147
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,5 @@
+services:
+  foo:
+    build:
+      context: .
+      dockerfile: foo/Dockerfile
diff --git a/foo/Dockerfile b/foo/Dockerfile
new file mode 100644
index 0000000..917a55a
--- /dev/null
+++ b/foo/Dockerfile
@@ -0,0 +1,3 @@
+FROM alpine:3.14
+COPY shared/hello.txt /app
+ENTRYPOINT ["sleep", "infinity"]
diff --git a/shared/hello.txt b/shared/hello.txt
new file mode 100644
index 0000000..557db03
--- /dev/null
+++ b/shared/hello.txt
@@ -0,0 +1 @@
+Hello World

4.27.2 Is working for me and the upgrade from 4.27.1 to 4.27.2 had no issues for me.

Also working on my side with 4.27.2! Many thanks for the quick fix!

yes. same here. waiting for a desktop release that covers the new compose release. thanks @crazy-max @MichelZ ! as far as i am concerned the issue can be closed here (compose is fixed). is there a different github project / repo for docker desktop where this issue should be mentioned (so new bugfix release can come in ?) thanks again .!

Just experienced this issue. I solved following the @MichelZ workaround. Thanks!

Thanks for the work-around, @MichelZ. This solved the issue for me.