Skip to content

Commit

Permalink
Add DockerBuild.sh and DockerRun.sh helper scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
calh authored and lanewei120 committed Mar 2, 2023
1 parent 36e2179 commit a664128
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
15 changes: 15 additions & 0 deletions DockerBuild.sh
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
23 changes: 23 additions & 0 deletions DockerRun.sh
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 $*

0 comments on commit a664128

Please sign in to comment.