Skip to content

Commit

Permalink
Update Containerfile to make it Docker compatible
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
deftdawg authored and lanewei120 committed Dec 9, 2022
1 parent 91db1be commit e434009
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"
Expand Down Expand Up @@ -46,7 +52,7 @@ RUN apt-get update && apt-get install -y \
file \
sudo

COPY ../BambuStudio BambuStudio
COPY ./ BambuStudio

WORKDIR BambuStudio

Expand Down

0 comments on commit e434009

Please sign in to comment.