Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
octodash: Base default Dockerfile on binary installation, since build…
Browse files Browse the repository at this point in the history
…ing is difficult UnchartedBull/OctoDash#760
  • Loading branch information
MatthewCroughan committed Jun 24, 2020
1 parent 10e0470 commit ddff60f
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 73 deletions.
28 changes: 28 additions & 0 deletions octodash/Dockerfile.binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian:buster

ARG VERSION=1.5.0

RUN install_packages \
xserver-xorg-core \
xserver-xorg-input-all \
xserver-xorg-video-fbdev \
xorg \
libgtk3.0 \
libnss3 \
libxss1 \
libasound2 \
jq

RUN echo "#!/bin/bash" > /etc/X11/xinit/xserverrc \
&& echo "" >> /etc/X11/xinit/xserverrc \
&& echo 'exec /usr/bin/X -s 0 dpms -nocursor -nolisten tcp "$@"' >> /etc/X11/xinit/xserverrc

WORKDIR /usr/src/app
COPY ./start.sh ./start.sh
COPY config.json /root/.config/octodash/config.json

RUN curl -sL https://github.com/UnchartedBull/OctoDash/releases/download/v""$VERSION""/octodash_""$VERSION""_$(uname -m).deb -o octodash.deb && \
dpkg -i --ignore-depends=libnotify4,xdg-utils,libappindicator3-1,libsecret-1-0 octodash.deb && \
rm octodash.deb

CMD ["bash","/usr/src/app/start.sh"]
72 changes: 72 additions & 0 deletions octodash/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
###
# Build stage
##
FROM balenalib/%%BALENA_MACHINE_NAME%%-node:latest-build as build
ARG octodash_version=v1.5.0
RUN echo "arch=$(uname -m)" > ~/.npmrc

# Move to app dir
WORKDIR /usr/src/app

# Install build dependencies
RUN install_packages \
apt-utils \
clang \
libxcb-image0 \
libxcb-util0 \
xdg-utils \
libdbus-1-dev \
libgtk2.0-dev \
libnotify-dev \
libgnome-keyring-dev \
libgconf2-dev \
libasound2-dev \
libcap-dev \
libcups2-dev \
libxtst-dev \
libxss1 \
libnss3-dev \
libsmbclient \
libssh-4 \
libexpat-dev \
git

# Clone project to filesystem, checkout octodash_version and remove git index to save space
RUN git clone https://github.com/UnchartedBull/OctoDash.git && cd OctoDash && git checkout $octodash_version && rm -rf .git

# Install npm modules for the application and compile
RUN cd OctoDash && npm install && npm run ng:build

###
# Runtime
##
FROM balenalib/%%BALENA_MACHINE_NAME%%-node:latest-run
RUN echo "arch=$(uname -m)" > ~/.npmrc

# Move to app dir
WORKDIR /usr/src/app

# Install runtime dependencies

RUN install_packages \
xserver-xorg-core \
xserver-xorg-input-all \
xserver-xorg-video-fbdev \
xorg \
libgtk3.0 \
libnss3 \
libxss1 \
libasound2 \
jq

RUN echo "#!/bin/bash" > /etc/X11/xinit/xserverrc \
&& echo "" >> /etc/X11/xinit/xserverrc \
&& echo 'exec /usr/bin/X -s 0 dpms -nocursor -nolisten tcp "$@"' >> /etc/X11/xinit/xserverrc

# Copy the app from the build step
COPY --from=build /usr/src/app/OctoDash /usr/src/app/OctoDash

COPY ./start.sh /usr/src/app/start.sh
COPY config.json /root/.config/octodash/config.json

CMD ["bash","/usr/src/app/start.sh"]
72 changes: 0 additions & 72 deletions octodash/Dockerfile.template

This file was deleted.

1 change: 1 addition & 0 deletions octodash/Dockerfile.template
2 changes: 1 addition & 1 deletion octodash/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ umount /dev/shm && mount -t tmpfs shm /dev/shm
## https://github.com/balena-io/resin-electronjs/blob/master/app/start.sh

rm /tmp/.X0-lock &>/dev/null || true
startx /usr/src/app/OctoDash/node_modules/electron/dist/electron /usr/src/app/OctoDash --enable-logging --no-sandbox
startx /opt/OctoDash/octodash --enable-logging --no-sandbox

0 comments on commit ddff60f

Please sign in to comment.