Deb: create Ubuntu 20.04 tarball and deb

This commit is contained in:
Dmitry Maksyoma 2021-01-19 22:44:32 +13:00
parent a4369e8897
commit 35cf095a31
8 changed files with 92 additions and 11 deletions

View File

@ -3,11 +3,12 @@
set -e
cd "$(dirname "$0")/.."
. builder/os_ver_cli.sh
docker build -t debbuilder_ubuntu:18.04 -f \
builder/dockerfile.ubuntu1804.deb.build .
docker build -t debbuilder_${os}:${os_ver} -f \
builder/dockerfile.${os}${os_ver_dockerfile}.deb.build .
deb_output_dir=$(cd .. && echo $PWD)
L_UID=$(id -u) #Ubuntu already has UID env var, but this should work on all Linix systems
L_GID=$(id -g)
docker run --rm -v "$deb_output_dir":/src --user $L_UID:$L_GID debbuilder_ubuntu:18.04 /bin/bash -c '/src/*/builder/build-deb-inside-docker'
docker run --rm -v "$deb_output_dir":/src --user $L_UID:$L_GID debbuilder_${os}:${os_ver} /bin/bash -c '/src/*/builder/build-deb-inside-docker'

View File

@ -8,15 +8,18 @@ build_www_dir() {
}
cd "$(dirname "$0")/.."
. builder/os_ver_cli.sh
build_www_dir
docker pull ubuntu:18.04
docker build -t kasmvncbuilder:18.04 -f builder/dockerfile.ubuntu1804.build .
docker pull "$os_image"
docker build -t kasmvncbuilder:$os_ver \
-f builder/dockerfile.ubuntu${os_ver_dockerfile}.build .
mkdir -p builder/build
docker run -v /tmp:/build --rm kasmvncbuilder:18.04
docker run -v /tmp:/build --rm kasmvncbuilder:$os_ver
L_GID=$(id -g)
L_UID=$(id -u)
chown $L_UID:$L_GID /tmp/kasmvnc.ubuntu_18.04.tar.gz
mv /tmp/kasmvnc.ubuntu_18.04.tar.gz $PWD/builder/build/
tarball_name="kasmvnc.${os}_${os_ver}.tar.gz"
chown $L_UID:$L_GID /tmp/$tarball_name
mv /tmp/$tarball_name $PWD/builder/build/

View File

@ -10,7 +10,7 @@ RUN sed -i 's$# deb-src$deb-src$' /etc/apt/sources.list
RUN apt-get update && \
apt-get -y install sudo
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
RUN apt-get update && apt-get install -y --no-install-recommends tzdata
RUN apt-get update && apt-get -y build-dep xorg-server libxfont-dev
RUN apt-get update && apt-get -y install cmake git libjpeg-dev libgnutls28-dev vim wget tightvncserver
RUN apt-get update && apt-get -y install libjpeg-dev libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev

View File

@ -0,0 +1,12 @@
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get -y install vim build-essential devscripts equivs
# Install build-deps for the package.
COPY ./debian/control /tmp
RUN echo YYY | mk-build-deps --install --remove /tmp/control
USER 1000

View File

@ -0,0 +1,52 @@
FROM ubuntu:20.04
ENV DISPLAY=:1 \
VNC_PORT=8443 \
VNC_RESOLUTION=1280x720 \
MAX_FRAME_RATE=24 \
VNCOPTIONS="-PreferBandwidth -DynamicQualityMin=4 -DynamicQualityMax=7" \
HOME=/home/user \
TERM=xterm \
STARTUPDIR=/dockerstartup \
INST_SCRIPTS=/dockerstartup/install \
KASM_RX_HOME=/dockerstartup/kasmrx \
DEBIAN_FRONTEND=noninteractive \
VNC_COL_DEPTH=24 \
VNC_RESOLUTION=1280x1024 \
VNC_PW=vncpassword \
VNC_USER=user \
VNC_VIEW_ONLY_PW=vncviewonlypassword \
LD_LIBRARY_PATH=/usr/local/lib/ \
OMP_WAIT_POLICY=PASSIVE \
SHELL=/bin/bash \
SINGLE_APPLICATION=0 \
KASMVNC_BUILD_OS=ubuntu \
KASMVNC_BUILD_OS_VER=18.04
EXPOSE $VNC_PORT
WORKDIR $HOME
### REQUIRED STUFF ###
RUN apt-get update && apt-get install -y supervisor xfce4 xfce4-terminal xterm libnss-wrapper gettext wget
RUN apt-get purge -y pm-utils xscreensaver*
RUN apt-get update && apt-get install -y vim less
RUN echo 'source $STARTUPDIR/generate_container_user' >> $HOME/.bashrc
RUN mkdir -p $STARTUPDIR
COPY startup/ $STARTUPDIR
### START CUSTOM STUFF ####
COPY build/*.deb /tmp
RUN dpkg -i /tmp/*.deb; apt-get -yf install
### END CUSTOM STUFF ###
RUN chown -R 1000:0 $HOME
USER 1000:kasmvnc
WORKDIR $HOME
ENTRYPOINT [ "/dockerstartup/vnc_startup.sh" ]

9
builder/os_ver_cli.sh Normal file
View File

@ -0,0 +1,9 @@
default_os=ubuntu
default_os_ver=18.04
os=${1:-$default_os}
os_ver=${2:-$default_os_ver}
os_ver_dockerfile=`echo $os_ver | sed 's/\.//g'`
os_image="$os:$os_ver"
echo "Building for $os_image"

View File

@ -3,6 +3,8 @@
set -e
cd "$(dirname "$0")"
. ./os_ver_cli.sh
docker build -t kasmvnctester-deb:18.04 -f dockerfile.ubuntu1804.deb.test .
docker build -t kasmvnctester-deb:$os_ver \
-f dockerfile.${os}${os_ver_dockerfile}.deb.test .
#docker run -it -p 443:8443 --rm -e "VNC_USER=username" -e "VNC_PW=password123" kasmvnctester-deb:18.04

View File

@ -1,4 +1,6 @@
TARBALL := builder/build/kasmvnc.ubuntu_18.04.tar.gz
TARGET_OS := $(shell lsb_release -is | tr '[:upper:]' '[:lower:]')
TARGET_OS_VER := $(shell lsb_release -rs)
TARBALL := builder/build/kasmvnc.$(TARGET_OS)_$(TARGET_OS_VER).tar.gz
TAR_DATA := $(shell mktemp -d)
SRC := $(TAR_DATA)/usr/local
SRC_BIN := $(SRC)/bin