From f0b00968c7c4aa5444ba78a9a412ab886eee291c Mon Sep 17 00:00:00 2001 From: Yike Chen <33338982+PatrickChenHZ@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:27:59 -0600 Subject: [PATCH 1/2] Fix Build Dependency Allow latest version to build in Docker. Latest Revision require ffmpeg 7 to get libvodec61. Which means base image must be updated to ubuntu 24.10 --- Dockerfile | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 58834089e6..0d708d6324 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM docker.io/ubuntu:22.04 -LABEL maintainer "DeftDawg " +FROM docker.io/ubuntu:24.10 # Disable interactive package configuration RUN apt-get update && \ @@ -14,10 +13,13 @@ RUN apt-get update && apt-get install -y \ build-essential \ cmake \ curl \ + bc \ + xvfb \ eglexternalplatform-dev \ extra-cmake-modules \ file \ git \ + ffmpeg \ gstreamer1.0-plugins-bad \ gstreamer1.0-libav \ libcairo2-dev \ @@ -39,7 +41,6 @@ RUN apt-get update && apt-get install -y \ libssl-dev \ libudev-dev \ libwayland-dev \ - libwebkit2gtk-4.0-dev \ libxkbcommon-dev \ locales \ locales-all \ @@ -47,8 +48,14 @@ RUN apt-get update && apt-get install -y \ pkgconf \ sudo \ wayland-protocols \ + bash \ wget +#Temporary fix for 24.10 dependency +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 @@ -81,14 +88,22 @@ RUN ./BuildLinux.sh -i # 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 the commands with proper bash syntax +RUN if [ "$UID" != "0" ]; then \ + groupadd -f -g $GID $USER && \ + useradd -u $UID -g $GID $USER; \ + fi + +#RUN chmod +x entrypoint.sh # 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"] \ No newline at end of file From c9e68cee6dfb84486a519fd1c18964024c8d7b89 Mon Sep 17 00:00:00 2001 From: PatrickChenHZ <2540932806@qq.com> Date: Sat, 30 Nov 2024 13:43:14 -0600 Subject: [PATCH 2/2] modify docker file to point ffmpeg to binary at build time, as well as update a couple deprecated docker syntax. Also added more troubleshooting recommendations to DockerRun.sh --- DockerRun.sh | 10 ++++++++++ Dockerfile | 13 ++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/DockerRun.sh b/DockerRun.sh index acc93f5473..212d9d9e67 100755 --- a/DockerRun.sh +++ b/DockerRun.sh @@ -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 \ diff --git a/Dockerfile b/Dockerfile index 0d708d6324..8d331ae6dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,6 @@ RUN apt-get update && apt-get install -y \ extra-cmake-modules \ file \ git \ - ffmpeg \ gstreamer1.0-plugins-bad \ gstreamer1.0-libav \ libcairo2-dev \ @@ -51,7 +50,7 @@ RUN apt-get update && apt-get install -y \ bash \ wget -#Temporary fix for 24.10 dependency +#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 @@ -65,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 @@ -80,7 +79,7 @@ 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, @@ -96,13 +95,13 @@ ARG USER=root ARG UID=0 ARG GID=0 -# Run the commands with proper bash syntax RUN if [ "$UID" != "0" ]; then \ groupadd -f -g $GID $USER && \ useradd -u $UID -g $GID $USER; \ fi -#RUN chmod +x entrypoint.sh +# 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.