Update Containerfile to make it Docker compatible

- Replace COPY command with Docker compatible syntax
- Rename container tag to bambu-studio-builder so as to not confuse with a container that would actually run Bambu Studio
- Add Docker alternative build method (thx @SG-R)
- Update podman syntax to remove unnecessary sudo
This commit is contained in:
deftdawg 2022-12-08 15:01:49 -05:00 committed by Lane.Wei
parent 91db1be09e
commit e434009577

View file

@ -1,16 +1,22 @@
# Build Bambu Slicer in a container
#
# Build an AppImage:
# rm -rf build; sudo podman build . -t bambu-studio && sudo podman run --rm localhost/bambu-studio /bin/bash -c 'tar -c $(find build | grep ubu64.AppImage | head -1)' | tar -xv
# Build an AppImage using rootless Podman (refer to https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md):
# rm -rf build; podman build . -t bambu-studio-builder && podman run --rm localhost/bambu-studio-builder /bin/bash -c 'tar -c $(find build | grep ubu64.AppImage | head -1)' | tar -xv
#
# Troubleshooting the build container:
# sudo podman run -it --name bambu-studio localhost/bambu-studio /bin/bash
# podman run -it --name bambu-studio-builder localhost/bambu-studio-builder /bin/bash
#
# Debugging the resulting AppImage:
# 1) Install `gdb`
# 2) In a terminal in the same directory as the AppImage, start it with following:
# echo -e "run\nbt\nquit" | gdb ./BambuStudio_ubu64.AppImage
# 3) Find related issue using backtrace output for clues and add backtrace to it on github
#
# Docker alternative AppImage build syntax (use this if you can't install podman):
# rm -rf build; docker build . --file Containerfile -t bambu-studio-builder; docker run --rm bambu-studio-builder /bin/bash -c 'tar -c $(find build | grep ubu64.AppImage | head -1)' | tar -xv
#
#
# TODO: bind mount BambuStudio to inside the container instead of COPY to enable faster rebuilds during dev work.
FROM docker.io/ubuntu:20.04
LABEL maintainer "DeftDawg <DeftDawg@gmail.com>"
@ -46,7 +52,7 @@ RUN apt-get update && apt-get install -y \
file \
sudo
COPY ../BambuStudio BambuStudio
COPY ./ BambuStudio
WORKDIR BambuStudio