diff --git a/Dockerfile b/Dockerfile index de07516..b488276 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ ## Author: Nelson E Hernandez -## Date: FROM centos:centos6.9 ## install build tools -RUN /usr/bin/yum groupinstall -y "Development Tools" -RUN /usr/bin/yum install -y wget +RUN /usr/bin/yum -y update && /usr/bin/yum groupinstall -y "Development Tools" && yum clean all +RUN /usr/bin/yum install -y wget && yum install -y epel-release && yum install -y jq RUN wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage \ && chmod +x linuxdeploy-x86_64.AppImage \ @@ -23,4 +22,11 @@ RUN sh autogen.sh && \ ./configure --prefix=/tmux/MakeBuild && \ make install +## complete the appimage build. +COPY ./opt /opt +RUN /opt/build.sh + +## Produces artifact +## /opt/releases/tmux-3.0a-x86_64.AppImage + CMD /opt/build.sh diff --git a/README.md b/README.md index b89c01b..391c110 100644 --- a/README.md +++ b/README.md @@ -17,18 +17,17 @@ git clone https://github.com/nelsonenzo/tmux-appimage.git ## compile tmux from source by building container docker build . -t tmux -## make appimage by running container -docker run -it -v "$PWD"/opt:/opt tmux - -## expected output: -./opt/releases/tmux-3.0a-x86_64.AppImage +## extract the appimage file +docker create -ti --name tmuxcontainer tmux bash +docker cp tmuxcontainer:/opt/releases/tmux-3.0a-x86_64.AppImage . +docker rm -f tmuxcontainer ``` ## To use AppImage move appimage to executable location in your $PATH ``` -mv ./opt/releases/tmux.*AppImage /usr/bin/tmux +mv tmux.*AppImage /usr/local/bin/tmux tmux ``` diff --git a/opt/AppRun b/opt/AppRun new file mode 100644 index 0000000..16c9944 --- /dev/null +++ b/opt/AppRun @@ -0,0 +1,4 @@ +#!/bin/bash +HERE="$(dirname "$(readlink -f "${0}")")" +unset ARGV0 +exec "${HERE}/usr/bin/tmux" "$@" diff --git a/opt/build.sh b/opt/build.sh index c37260d..42c9adf 100755 --- a/opt/build.sh +++ b/opt/build.sh @@ -8,4 +8,6 @@ export OUTPUT="/opt/releases/tmux-$RELEASE_TAG-x86_64.AppImage" /usr/bin/linuxdeploy --appdir=AppDir \ -i /opt/tmux-logo-square.png \ -d /opt/tmux.desktop \ - -e MakeBuild/bin/tmux --output=appimage + -e MakeBuild/bin/tmux \ + --custom-apprun=/opt/AppRun \ + --output=appimage