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

Cleaned Dockerfile CMD entrypoints to make it easier to extend or buil… #590

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pathtofile
Copy link

Cleaned Dockerfile CMD entrypoints to make it easier to extend or build on top of built image.

In some situations you might want to run extra setup inside the container prior to qemu, or build on top of the built docker image using e.g. FROM sickcodes/docker-osx:naked.

Without this PR, when you change the CMD you'd need to also re-implement all of the checks and setup done by the original CMD.

With this PR, you can first call your own script first, then call bash -c entrypoint.sh after your code, and optionally have some post-QEMU code after the VM has shut down.

@sickcodes
Copy link
Owner

Hey @pathtofile this is great thanks for this so far.

I think this is almost there, I can make this into a wrapper so we can use -- etc. My argument against that is I'd simply be abstracting QEMU. I do have enough "sample size" of what people understand, logically agree with etc.

For QEMU extra commands, I added -e EXTRA so you can add extra QEMU lines.

For any of the other major variables, I added the ability to specify own, eg, --e CPU=max.

Importantly, these can be added as environment variables, as opposed to extra CMD args.

From memory, I avoided adding separate shell script, looong ago, as I wanted to keep everything inside the Dockerfile, without the need of any COPY. Mostly for cache reasons, and also that the Dockerfile can be pasted anywhere and go.

Give me a bit to go over the scenarios in my head.

The other way anyone can currently (using docker args) would be to simply overwrite, which is what I do with most things:

-v ~/new.sh:/home/arch/OSX-KVM/Launch. \

I can recall moving the serial generators to their own repo, and git pull/submodule, so I did violate the above rule already about keeping everything inside Dockerfile. Plus we also git clone the repo itself now.

More evidence for merging, after I added serial numbers, internet was required if wanted set serial etc.

Caveat to the above sentence I recall "hot swapping" serial numbers didn't affect iServices on a future boot when changing serial back.

I am fine with an Entrypoint standalone version tho, and adding persistent -v probably with that. docker exec didn't work properly from memory.

Lemme go over some stuff but yeah are you on Discord?

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

Successfully merging this pull request may close these issues.

2 participants