-
Notifications
You must be signed in to change notification settings - Fork 59
add docker scripts #210
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
base: main
Are you sure you want to change the base?
add docker scripts #210
Conversation
|
Instead of scripts, maybe these should be a makefile command? make build-docker for example? |
make assumes you even have make/gcc/etc installed, which a barebones linux install may not have, WSL does not for sure. the docker is guaranteed to. |
| @@ -0,0 +1 @@ | |||
| sudo docker run --name x1plus -it -v `pwd`:/work x1plus | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we have users run the prebuilt docker image instead of building it themselves? then we know they'll get the same thing we have in CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say yes, a prebuilt image is preferred - not everyone might have a powerful machine on hand to build the base image fast.
I'd probably also commit the /work directory into the image so that no git checkout is necessary for basic work/build. That way it's an atomic, "guaranteed to work" image.
Another note I'd add here is running the container in detached mode. With the current commands (especially the ones provided in the README), for each command, a new container is spun up then shut down once the command completes. With a detached container, just by referring to the name and using exec instead of run, a lot of resources can be saved.
For example the current README approach is:
$ docker run -u `id -u` -v `pwd`:/work x1plusbuild bash -c 'git config --global --add safe.directory /work'
$ docker run -u `id -u` -v `pwd`:/work x1plusbuild make scripts
$ scp scripts/getkey root@bambu:/tmp
$ ssh root@bambu /tmp/getkey >> localconfig.mk
$ docker run -u `id -u` -v `pwd`:/work x1plusbuild make
Which could be modified to:
$ docker run -d --name x1plus -u `id -u` -v `pwd`:/work x1plusbuild
$ docker exec -it x1plus bash -c 'git config --global --add safe.directory /work'
$ docker exec -it x1plus make scripts
$ scp scripts/getkey root@bambu:/tmp
$ ssh root@bambu /tmp/getkey >> localconfig.mk
$ docker exec -it x1plus make
$ docker stop x1plus
// Later on, the same container can be spun up with
$ docker start x1plus
|
I think I agree that this is not a |
i dont have make installed on the host because i dont want a minimalist host. build env is inside the container not outside. |
|
Personally I feel these are unneeded with good documentation, but that's just me. 🤷♂️ |
No description provided.