StratusFearMe21/cargo-appimage

[example] Example dockerfile to use with cargo-appimage

Closed this issue · 2 comments

It's not as easy as I thought and requires weird hacks to make appimagetool to play nice inside docker, so here's a Dockerfile (@StratusFearMe21 maybe add this in the readme? If you do so, close this issue)

Dockerfile

FROM rust:slim

RUN cargo install cargo-appimage
# file package is required by appimagetool
RUN apt-get update && apt-get install -y --no-install-recommends file wget

# Download appimagetool
RUN wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage -O /usr/local/bin/appimagetool
RUN chmod +x /usr/local/bin/appimagetool
# Path appimagetool magic byte: https://github.com/AppImage/pkg2appimage/issues/373#issuecomment-495754112
RUN sed -i 's|AI\x02|\x00\x00\x00|' /usr/local/bin/appimagetool
# Use appimagetool without fuse: https://github.com/AppImage/AppImageKit/wiki/FUSE#docker
RUN APPIMAGE_EXTRACT_AND_RUN=1 cargo appimage

ngl, never used docker, and never thought docker was used as a dev tool.

and a very convenient one too - you're sure that your building env is exactly the same with the rest of the contributors.

Thank you very much for fixing everything! 🚀