trunnion / cargo-acap

A tool to build Rust programs for the AXIS Camera Application Platform
Apache License 2.0
11 stars 5 forks source link

RFC: Add --no-docker option #11

Closed apljungquist closed 6 days ago

apljungquist commented 6 months ago

This is helpful if we want to build apps in Jenkins where it is convenient to install cargo-acap in a docker image and inconvenient to set up docker-in-docker.

Does that make sense?

If so I will clean up the PR.

willglynn commented 6 months ago

🤔 If you're intending to run cargo-acap inside a trunnion/cargo-acap image, we could:

  1. Build and ship cargo-acap inside the image with the -axis- Rust toolchain and SDKs, and
  2. Set an environment variable for the image which cargo-acap can detect

The net result being that the user can either install cargo-acap on the host and let it invoke docker, or the user can use that image with the container runtime of their choosing and run cargo-acap inside. I think this might address your situation but I'm not sure.

If you're intending to use cargo-acap with a self-installed Axis SDK and cross-compilers and such, without the trunnion/cargo-acap image, I'd like to know more about your setup. cargo-acap would lose the conditional compilation feature but I guess it could still handle packaging 🤷‍♂️

apljungquist commented 5 months ago

Sorry for the late reply, I should have predicted that opening a PR right before going on vacation is a bad idea.

That does indeed sound like it would address my situation.

Re 1; I had not thought of this and it is not critical for my use case since I will always have a Dockerfile. But it's neat and unlikely to add much overhead, so I like it.

Re 2; It is also possible to detect docker automatically but I think your suggestion is better since it let's the user choose explicitly what to do. Compared to using command line options I also like that commands will be the same inside and outside the container, (but I also recognize this could be due to an excessive desire for tidiness :grin:).

I'll update the PR to incorporate your suggestions.