-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DockerBuild.sh and DockerRun.sh helper scripts
- Loading branch information
1 parent
36e2179
commit a664128
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
PROJECT_ROOT=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)") | ||
|
||
set -x | ||
|
||
# Wishlist hint: For developers, creating a Docker Compose | ||
# setup with persistent volumes for the build & deps directories | ||
# would speed up recompile times significantly. For end users, | ||
# the simplicity of a single Docker image and a one-time compilation | ||
# seems better. | ||
docker build -t bambustudio \ | ||
--build-arg USER=$USER \ | ||
--build-arg UID=$(id -u) \ | ||
--build-arg GID=$(id -g) \ | ||
$PROJECT_ROOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
set -x | ||
# Just in case, here's some other things that might help: | ||
# Force the container's hostname to be the same as your workstation | ||
# -h $HOSTNAME \ | ||
# just give it all privileges if there's a wierd error | ||
# --privileged=true \ | ||
# If there's problems with the X display, try this | ||
# -v /tmp/.X11-unix:/tmp/.X11-unix \ | ||
docker run \ | ||
`# Use the hosts networking. Printer wifi and also dbus communication` \ | ||
--net=host \ | ||
`# Run as your workstations username to keep permissions the same` \ | ||
-u $USER \ | ||
`# Bind mount your home directory into the container for loading/saving files` \ | ||
-v $HOME:/home/$USER \ | ||
`# Pass the X display number to the container` \ | ||
-e DISPLAY=$DISPLAY \ | ||
`# Attach tty for running bambu with command line things` \ | ||
-ti \ | ||
`# Pass all parameters from this script to the bambu ENTRYPOINT binary` \ | ||
bambustudio $* | ||
|