-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Docker compose commands being run within turbo fails to stop the container after exiting the task with cntrl+c #10020
Comments
Please note that it is possible that this is not a bug and actually expected behavior. I am just trying to have a quick database to be spun up when I run my dev scripts, and for it to go down when I stop developing. This should be quite a common scenario/setup so it's possible my setup is wrong in some way. |
I have just verified that this is problem is not happening on my Ubuntu linux machine. Only MacOS. Here's the docker info installed at my linux system:
|
I've been able to reproduce this on my macOS. There's something odd with |
I'm also seeing this on Mac and only with Turborepo. Tried to do a JS-only implementation of what I had in a package.json script in a workspace, but still saw the early exit (with code 130) when using turborepo. Click to expand code example 👈import { spawn } from "child_process";
import path from "path";
const spawnOptions = {
stdio: "inherit",
cmd: path.resolve(__dirname, "../"),
} as const;
spawn(
"docker",
["compose", "-f", "./docker-compose.dev.yml", "up"],
spawnOptions,
);
const cleanup = () => {
console.log("Cleaning up...");
new Promise((resolve) => {
const downProcess = spawn(
"docker",
["compose", "-f", "./docker-compose.dev.yml", "down"],
spawnOptions,
);
downProcess.on("close", (code) => {
resolve(true);
});
}).catch((err: unknown) => {
console.error("Error cleaning up", err);
});
};
["SIGINT", "SIGTERM", "SIGQUIT"].forEach((signal) => {
process.on(signal, cleanup);
}); What's interesting is that if I run With In the console I see the cleanup script get called |
Verify canary release
Link to code that reproduces this issue
https://github.com/dBianchii/docker-turbo-pnpm-issue-reproduction
Which canary version will you have in your reproduction?
2.4.3-canary.3
Enviroment information
Expected behavior
Let's say that
packages/db
has a docker-compose.yml file with simple postgres service. Let`s say this package has a package.json like this:When I run
turbo dev
from the root, this command will be run in parallel with my other dev scripts. This is what I want.When I am done with working with my task and hit
cntrl+C
in my terminal, the docker container should be stopped.Actual behavior
The docker container described in the scenario above is not exiting when I hit
cntrl+c
To Reproduce
turbo dev
cntrl+c
Additional context
Here is my docker info:
Client:
Version: 27.5.1
Context: desktop-linux
Debug Mode: false
Plugins:
ai: Ask Gordon - Docker Agent (Docker Inc.)
Version: v0.7.3
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-ai
buildx: Docker Buildx (Docker Inc.)
Version: v0.20.1-desktop.2
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.32.4-desktop.1
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-compose
debug: Get a shell into any image or container (Docker Inc.)
Version: 0.0.38
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-debug
desktop: Docker Desktop commands (Beta) (Docker Inc.)
Version: v0.1.4
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-desktop
dev: Docker Dev Environments (Docker Inc.)
Version: v0.1.2
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-dev
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.27
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-extension
feedback: Provide feedback, right in your terminal! (Docker Inc.)
Version: v1.0.5
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-feedback
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v1.4.0
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-init
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
Version: 0.6.0
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-sbom
scout: Docker Scout (Docker Inc.)
Version: v1.16.1
Path: /Users/gabrielbianchi/.docker/cli-plugins/docker-scout
Server:
Containers: 13
Running: 0
Paused: 0
Stopped: 13
Images: 11
Server Version: 27.5.1
Storage Driver: overlayfs
driver-type: io.containerd.snapshotter.v1
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
runc version: v1.1.12-0-g51d5e946
init version: de40ad0
Security Options:
seccomp
Profile: unconfined
cgroupns
Kernel Version: 6.12.5-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: aarch64
CPUs: 12
Total Memory: 7.653GiB
Name: docker-desktop
ID: d03d7f68-28be-48a2-95c9-4ebf0fb01b87
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
Labels:
com.docker.desktop.address=unix:///Users/gabrielbianchi/Library/Containers/com.docker.docker/Data/docker-cli.sock
Experimental: false
Insecure Registries:
hubproxy.docker.internal:5555
127.0.0.0/8
Live Restore Enabled: false
The text was updated successfully, but these errors were encountered: