open-telemetry / opentelemetry-demo

This repository contains the OpenTelemetry Astronomy Shop, a microservice-based distributed system intended to illustrate the implementation of OpenTelemetry in a near real-world environment.
https://opentelemetry.io/docs/demo/
Apache License 2.0
1.76k stars 1.13k forks source link

`docker compose up` is broken on macOS #1739

Open trentm opened 1 week ago

trentm commented 1 week ago

Bug Report

Which version of the demo you are using? commit 6d074fb69f66bfc3db7ef7f80fdb159d76a4835e

Symptom

The recent change in https://github.com/open-telemetry/opentelemetry-demo/pull/1728 breaks docker compose up on macOS:

% docker compose up -d
[+] Running 7/8
 ✔ Container jaeger       Running                                              0.0s
 ✔ Container kafka        Running                                              0.0s
 ✔ Container grafana      Running                                              0.0s
 ✔ Container valkey-cart  Running                                              0.0s
 ✔ Container opensearch   Healthy                                              3.5s
 ✔ Container flagd        Running                                              0.0s
 ✔ Container prometheus   Running                                              0.0s
 ⠋ Container otel-col     Starting                                             0.1s
Error response from daemon: path / is mounted on / but it is not a shared or slave mount

When I apply the following change, I am able to bring the services up:

diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml
index 585bed0..07b1173 100644
--- a/docker-compose.minimal.yml
+++ b/docker-compose.minimal.yml
@@ -585,7 +585,7 @@ services:
     command: ["--config", "/etc/otelcol-config.yml", "--config", "/etc/otelcol-config-extras.yml" ]
     user: 0:0
     volumes:
-      - ${HOST_FILESYSTEM}:/hostfs:ro,rslave
+      - ${HOST_FILESYSTEM}:/hostfs:ro
       - ${DOCKER_SOCK}:/var/run/docker.sock:ro
       - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml
       - ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml
diff --git a/docker-compose.yml b/docker-compose.yml
index 014c2b4..990e36f 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -696,7 +696,7 @@ services:
     command: ["--config", "/etc/otelcol-config.yml", "--config", "/etc/otelcol-config-extras.yml" ]
     user: 0:0
     volumes:
-      - ${HOST_FILESYSTEM}:/hostfs:ro,rslave
+      - ${HOST_FILESYSTEM}:/hostfs:ro
       - ${DOCKER_SOCK}:/var/run/docker.sock:ro
       - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml
       - ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml

Additional Context

Myself and another co-worker are hitting this. We are both on macOS/arm.

% uname -v
Darwin Kernel Version 23.6.0: Wed Jul 31 20:48:04 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6030
JessicaGarson commented 1 week ago

I also had the same experience here as well but with make start:

Darwin Kernel Version 23.6.0: Wed Jul 31 20:48:52 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6020

I was able to get the demo running by checking out older commits from this repo such as:

git checkout b77c589be4868284064bb96b460d82ed63a1106e
rogercoll commented 1 week ago

@trentm @JessicaGarson Could you share the Docker version you had the issue with?

If you upgrade Docker 27.2.1+, does the issue persist?

This issue was reported for the latest Docker versions: https://github.com/docker/compose/issues/12139

JessicaGarson commented 1 week ago

I was using Docker Desktop 4.34.3. I had an earlier version and tried upgrading it as part of the troubleshooting process.

Screenshot 2024-10-10 at 8 31 54 AM
Docker version 27.2.0, build 3ab4256
trentm commented 1 week ago

^^ Same for me: Docker Desktop 4.34.3 (170107) is currently the newest version available. which on the CLI corresponds to docker 27.2.0:

% docker version
Client:
 Version:           27.2.0
 API version:       1.47
 Go version:        go1.21.13
 Git commit:        3ab4256
 Built:             Tue Aug 27 14:14:45 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.34.3 (170107)
 Engine:
  Version:          27.2.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.21.13
  Git commit:       3ab5c7d
  Built:            Tue Aug 27 14:15:41 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.7.20
  GitCommit:        8fc6bcff51318944179630522a095cc9dbf9f353
 runc:
  Version:          1.1.13
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Assuming I have this right and that /usr/local/bin/docker was actually installed by Docker Desktop.

I notice that brew has a newer version of Docker available:

% brew info docker
==> docker: stable 27.3.1 (bottled), HEAD
Pack, ship and run any application as a lightweight container
https://www.docker.com/
Not installed
trentm commented 1 week ago

I guess Docker Desktop releases lag on the docker engine version included. Docker Desktop v4.34.0 release notes mention updating Docker Engine to v27.2.0: https://docs.docker.com/desktop/release-notes/#4340

trentm commented 1 week ago

That docker compose fix (* 9c60fe67d - (tag: v2.29.7) revert commits link to mount API over bind changes (3 weeks ago)) was tagged v2.29.7

% docker compose version
Docker Compose version v2.29.2-desktop.2

So perhaps we need to wait for Docker Desktop to get a release with v2.29.7 out?

julianocosta89 commented 1 week ago

This is interesting.

I'm in a super outdated version on Mac and I don't have this issue.

My current version is: 4.26.1 (131620).

zzzk1 commented 1 week ago

I am experiencing this issues too, Docker Desktop 4.34.3 (170107)

mviitane commented 1 week ago

I'm running 4.28.0 (139021) and this old version is running fine.

$ docker version
Client:
 Cloud integration: v1.0.35+desktop.11
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:26 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.28.0 (139021)
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:14:22 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
trentm commented 1 week ago

I'm in a super outdated version on Mac and I don't have this issue.

yah, the issue was caused by a compasses change that was then reverted. So there is a range of versions of docker compose where this is broken.

julianocosta89 commented 1 week ago

@trentm is there anything we can do on our end? Or should we close this issue?

trentm commented 1 week ago

I guess that is up to the maintainers of this repo. Personally I'd keep it open until the issue is fixed... which I think is personal until Docker releases a Docker Desktop for macOS that includes the updated docker compose. I don't know what the process is for updating compose in Docker Desktop.