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

Strange Interaction Between cargo-make and Docker Compose #1193

Open
gatoWololo opened this issue Nov 28, 2024 · 0 comments
Open

Strange Interaction Between cargo-make and Docker Compose #1193

gatoWololo opened this issue Nov 28, 2024 · 0 comments
Assignees

Comments

@gatoWololo
Copy link

gatoWololo commented Nov 28, 2024

Describe The Bug

Hello, I ran into a very strange bug. After hours of debugging I have narrowed down the issue to our use of cargo make.

We use ssh agent forwarding with Docker Compose when building our server. This allows our cargo build job to have access to our ssh agent when building our server in Docker. This is needed as our server depends on private Github Rust dependencies.

We use cargo-make to define our server start task as such (we use foo to hide acutal name of our server):

# Start a foo server in the background
[tasks.start]
command = "docker"
args = ["compose", "up", 
        "--build", "postgres", "nginx", "foo_server", "foo_client_auth", "foo_nginx",
        "--wait",
]

Calling the command manually e.g. docker compose up ... always works. However calling the command via this cargo-make task definition e.g. cargo make start fails most of the time with an error of cargo not being able to access the ssh agent. The strange part is that this behavior is intermittent. Calling cargo make start enough times causes it to randomly succeed sometimes.

I don't see how cargo-make could possible be the issue, but after exhausting every other possibility, I narrowed it down to cargo-make as the culprit. I'm guessing there is some Docker bug that only manifests when being ran as a sub-process... but who knows.

I don't expect this bug to be looked at, as our issue is extremely specific and involves several technologies working together: cargo, ssh-agent, Docker, docker compose, etc. But I wanted to document this somewhere in case anyone else ever runs into it and tries searching for it.

Btw: We love cargo-make! This is an awesome utility.

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

2 participants