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

Fix Build Dependency for Docker #5156

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions DockerRun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ set -x
# -h $HOSTNAME \
# If there's problems with the X display, try this
# -v /tmp/.X11-unix:/tmp/.X11-unix \
# or
# -v $HOME/.Xauthority:/root/.Xauthority
# You also need to run "xhost +" on your host system
# Bambu Studio also require the parent directory for the configuration directory to be present to start
# which means it is important to make sure user is passed to container correctly
# if the following configuration does not work with error: "boost::filesystem::create_directory: No such file or directory"
# try replacing -u line with
# -u $(id -u ${USER}):$(id -g ${USER}) \
# and add
# -e HOME=/home/$USER \
docker run \
`# Use the hosts networking. Printer wifi and also dbus communication` \
--net=host \
Expand Down
34 changes: 24 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM docker.io/ubuntu:22.04
LABEL maintainer "DeftDawg <[email protected]>"
FROM docker.io/ubuntu:24.10

# Disable interactive package configuration
RUN apt-get update && \
Expand All @@ -14,6 +13,8 @@ RUN apt-get update && apt-get install -y \
build-essential \
cmake \
curl \
bc \
xvfb \
eglexternalplatform-dev \
extra-cmake-modules \
file \
Expand All @@ -39,16 +40,21 @@ RUN apt-get update && apt-get install -y \
libssl-dev \
libudev-dev \
libwayland-dev \
libwebkit2gtk-4.0-dev \
libxkbcommon-dev \
locales \
locales-all \
m4 \
pkgconf \
sudo \
wayland-protocols \
bash \
wget

#Temporary fix for 24.10 dependency, 24.10 still required for ffmpeg7 to run Bug-free
RUN echo 'deb http://gb.archive.ubuntu.com/ubuntu jammy main' >> /etc/apt/sources.list

RUN apt-get update && apt-get install -y libwebkit2gtk-4.0-dev

# Change your locale here if you want. See the output
# of `locale -a` to pick the correct string formatting.
ENV LC_ALL=en_US.utf8
Expand All @@ -58,9 +64,9 @@ RUN locale-gen $LC_ALL
# the CA cert path on every startup
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

COPY ./ BambuStudio
COPY ./ /BambuStudio

WORKDIR BambuStudio
WORKDIR /BambuStudio

# These can run together, but we run them seperate for podman caching
# Update System dependencies
Expand All @@ -73,22 +79,30 @@ RUN ./BuildLinux.sh -d
RUN ./BuildLinux.sh -s

# Build AppImage
ENV container podman
ENV container=podman
RUN ./BuildLinux.sh -i

# It's easier to run Bambu Studio as the same username,
# UID and GID as your workstation. Since we bind mount
# your home directory into the container, it's handy
# to keep permissions the same. Just in case, defaults
# are root.
# Use bash as the shell
SHELL ["/bin/bash", "-l", "-c"]

# Set ARG values
ARG USER=root
ARG UID=0
ARG GID=0
RUN [[ "$UID" != "0" ]] \
&& groupadd -f -g $GID $USER \
&& useradd -u $UID -g $GID $USER

RUN if [ "$UID" != "0" ]; then \
groupadd -f -g $GID $USER && \
useradd -u $UID -g $GID $USER; \
fi

# Point FFMPEG Library search to the binary built upon BambuStudio build time
ENV LD_LIBRARY_PATH=/BambuStudio/build/package/bin

# Using an entrypoint instead of CMD because the binary
# accepts several command line arguments.
ENTRYPOINT ["/BambuStudio/build/package/bin/bambu-studio"]
ENTRYPOINT ["/BambuStudio/build/package/bin/bambu-studio"]