From 6cfeec48e8f71836612659cc6831139ff5d2b41c Mon Sep 17 00:00:00 2001 From: Strubbl <97055+Strubbl@users.noreply.github.com> Date: Mon, 14 Oct 2019 11:15:00 +0200 Subject: [PATCH] Add Dockerfile to run Chiaki in a Container (#50) --- scripts/Dockerfile | 55 +++++++++++++++++++++++++++++++++++++ scripts/Dockerfile.ubuntu | 57 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 scripts/Dockerfile create mode 100644 scripts/Dockerfile.ubuntu diff --git a/scripts/Dockerfile b/scripts/Dockerfile new file mode 100644 index 0000000..124a975 --- /dev/null +++ b/scripts/Dockerfile @@ -0,0 +1,55 @@ +# Run chiaki in a container +# xhost +"local:docker@" +# docker run -v $HOME/chiaki:/home/ps4/.local/share/Chiaki \ +# -v /tmp/.X11-unix:/tmp/.X11-unix \ +# --net host \ +# -e DISPLAY=$DISPLAY \ +# --device /dev/snd \ +# --name chiaki +# --rm \ +# strubbl_chiaki + +FROM alpine:3 AS builder +LABEL maintainer="Strubbl " +WORKDIR /app +RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ + && apk update \ + && apk --no-cache add \ + build-base \ + cmake \ + ffmpeg-dev \ + git \ + openssl \ + opus-dev \ + protobuf \ + py3-protobuf@testing \ + qt5-qtbase \ + qt5-qtmultimedia-dev \ + qt5-qtsvg-dev \ + sdl2-dev \ + && git clone https://github.com/thestr4ng3r/chiaki.git /app \ + && git submodule update --init \ + && mkdir build \ + && cd build \ + && cmake .. \ + && make \ + && ./test/chiaki-unit \ + && rm -rf /var/cache/apk/* + +FROM alpine:3 +RUN apk update \ + && apk --no-cache add \ + ffmpeg \ + qt5-qtbase \ + qt5-qtmultimedia \ + qt5-qtsvg \ + sdl2 \ + && rm -rf /var/cache/apk/* \ + && addgroup ps4 && adduser -D -G ps4 ps4 \ + && chown -R ps4: /home/ps4 +WORKDIR /home/ps4 +COPY --from=builder /app/build/gui/chiaki . +USER ps4 +VOLUME /home/ps4/.local/share/Chiaki +CMD ["/home/ps4/chiaki"] + diff --git a/scripts/Dockerfile.ubuntu b/scripts/Dockerfile.ubuntu new file mode 100644 index 0000000..9c862ee --- /dev/null +++ b/scripts/Dockerfile.ubuntu @@ -0,0 +1,57 @@ +# Run chiaki in a container +# docker run -v $HOME/chiaki:/home/ps4/.local/share/Chiaki \ +# -v /tmp/.X11-unix:/tmp/.X11-unix \ +# --net host \ +# -e DISPLAY=$DISPLAY \ +# --device /dev/snd \ +# --name chiaki +# --rm \ +# strubbl_chiaki + +FROM ubuntu:19.04 AS builder +LABEL maintainer="Strubbl " +ENV DEBIAN_FRONTEND noninteractive +WORKDIR /app +RUN apt-get update \ + && apt-get install -y \ + build-essential \ + cmake \ + git \ + protobuf-compiler \ + libavcodec-dev \ + libavutil-dev \ + libopus-dev \ + libqt5svg5-dev \ + libsdl2-dev \ + libssl-dev \ + python3 \ + python3-distutils \ + python3-protobuf \ + qt5-default \ + qtmultimedia5-dev \ + && git clone https://github.com/thestr4ng3r/chiaki.git /app \ + && git submodule update --init \ + && mkdir build \ + && cd build \ + && cmake .. \ + && make + +FROM ubuntu:19.04 +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update \ + && apt-get install -y \ + libavcodec58 \ + libavutil56 \ + libopus0 \ + libqt5multimedia5 \ + libqt5svg5 \ + libsdl2-2.0-0 \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* \ + && useradd -ms /bin/bash ps4 +WORKDIR /home/ps4 +USER ps4 +COPY --from=builder /app/build/gui/chiaki . +VOLUME /home/ps4/.local/share/Chiaki +ENTRYPOINT ["/home/ps4/chiaki"] +