2023-04-25 04:55:48 +02:00
|
|
|
#### Build Stage ####
|
2022-04-06 15:29:07 +02:00
|
|
|
ARG BASE_IMAGE="oraclelinux:8"
|
|
|
|
FROM $BASE_IMAGE AS install_tools
|
|
|
|
ARG DISTRO=oracle8
|
|
|
|
|
2023-04-25 04:55:48 +02:00
|
|
|
### Setup package rules
|
|
|
|
COPY ./src/ubuntu/install/package_rules $INST_SCRIPTS/package_rules/
|
|
|
|
RUN bash $INST_SCRIPTS/package_rules/package_rules.sh && rm -rf $INST_SCRIPTS/package_rules/
|
2022-04-06 15:29:07 +02:00
|
|
|
|
|
|
|
### Install common tools
|
|
|
|
COPY ./src/ubuntu/install/tools $INST_SCRIPTS/tools/
|
|
|
|
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
|
|
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
|
|
|
|
|
|
|
FROM install_tools AS squid_builder
|
|
|
|
|
|
|
|
ARG DISTRO=oracle8
|
|
|
|
|
2024-10-25 20:55:31 +02:00
|
|
|
RUN if [ "${DISTRO}" == "oracle8" ] || [ "${DISTRO}" == "oracle9" ] || [ "${DISTRO}" == "rockylinux9" ] || [ "${DISTRO}" == "rockylinux8" ] || [ "${DISTRO}" == "almalinux8" ] || [ "${DISTRO}" == "almalinux9" ] || [ "${DISTRO}" == "rhel9" ]; then \
|
2022-04-06 15:29:07 +02:00
|
|
|
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') && \
|
2023-03-15 21:09:15 +01:00
|
|
|
wget --progress=dot:giga "https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/1149fc830c7edcb383eec390cce2beba16befde5/output/kasm-squid-builder_${ARCH}.tar.gz"; \
|
2022-04-06 15:29:07 +02:00
|
|
|
else \
|
|
|
|
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') && \
|
2022-10-12 11:00:01 +02:00
|
|
|
wget --progress=dot:giga "https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/de1dffbc94d4132d6c696de8c6dfcd6f08900f61/output/kasm-squid-builder_centos_${ARCH}.tar.gz"; \
|
2022-04-06 15:29:07 +02:00
|
|
|
fi
|
|
|
|
RUN tar -xzf kasm-squid-builder_*.tar.gz -C /
|
|
|
|
|
2023-04-25 04:55:48 +02:00
|
|
|
FROM install_tools as base_layer
|
2022-04-06 15:29:07 +02:00
|
|
|
|
|
|
|
MAINTAINER Kasm Tech "info@kasmweb.com"
|
|
|
|
LABEL "com.kasmweb.image"="true"
|
|
|
|
|
|
|
|
### Environment config
|
|
|
|
ARG BG_IMG=bg_oracle.png
|
|
|
|
ARG EXTRA_SH=noop.sh
|
|
|
|
ARG DISTRO=oracle8
|
|
|
|
ARG LANG='en_US.UTF-8'
|
|
|
|
ARG LANGUAGE='en_US:en'
|
|
|
|
ARG LC_ALL='en_US.UTF-8'
|
2023-07-19 19:24:16 +02:00
|
|
|
ARG TZ='Etc/UTC'
|
2023-04-25 04:55:48 +02:00
|
|
|
ENV HOME=/home/kasm-default-profile \
|
2022-04-06 15:29:07 +02:00
|
|
|
TERM=xterm \
|
|
|
|
STARTUPDIR=/dockerstartup \
|
|
|
|
INST_SCRIPTS=/dockerstartup/install \
|
|
|
|
KASM_VNC_PATH=/usr/share/kasmvnc \
|
|
|
|
SHELL=/bin/bash \
|
|
|
|
START_XFCE4=$START_XFCE4 \
|
|
|
|
LANG=$LANG \
|
|
|
|
LANGUAGE=$LANGUAGE \
|
|
|
|
LC_ALL=$LC_ALL \
|
2023-07-19 19:24:16 +02:00
|
|
|
TZ=$TZ \
|
2023-06-28 22:16:30 +02:00
|
|
|
DISTRO=$DISTRO
|
2022-04-06 15:29:07 +02:00
|
|
|
|
|
|
|
WORKDIR $HOME
|
|
|
|
RUN mkdir -p $HOME/Desktop
|
|
|
|
|
|
|
|
### Ensure all needed packages are installed.
|
|
|
|
### Consider "yum install -y gettext nss_wraper". There's a typo in nss_wraper
|
|
|
|
### (should be nss_wrapper), and yum would just ignore it. Thus, a necessary
|
|
|
|
### package would be missing. With skip_missing_names_on_install, yum will exit
|
|
|
|
### with 1 exit code and that will stop image building.
|
2024-10-25 20:55:31 +02:00
|
|
|
RUN if [ "${DISTRO}" == "oracle8" ] || [ "${DISTRO}" == "oracle9" ] || [ "${DISTRO}" == "rockylinux9" ] || [ "${DISTRO}" == "rockylinux8" ] || [ "${DISTRO}" == "almalinux8" ] || [ "${DISTRO}" == "almalinux9" ] || [ "${DISTRO}" == "rhel9" ]; then \
|
2023-03-15 21:09:15 +01:00
|
|
|
dnf install -y 'dnf-command(config-manager)' && \
|
|
|
|
dnf config-manager --setopt=skip_missing_names_on_install=False --save && \
|
|
|
|
dnf clean all; \
|
2022-04-06 15:29:07 +02:00
|
|
|
else \
|
|
|
|
yum-config-manager --setopt=skip_missing_names_on_install=False --save; \
|
|
|
|
fi
|
|
|
|
|
2024-10-25 20:55:31 +02:00
|
|
|
### RHEL Tweaks
|
|
|
|
COPY ./src/ubuntu/install/rhel $INST_SCRIPTS/rhel/
|
|
|
|
RUN bash $INST_SCRIPTS/rhel/install_rhel.sh && rm -rf $INST_SCRIPTS/rhel/
|
|
|
|
|
2023-03-15 21:09:15 +01:00
|
|
|
### Copy over the maximization script to our startup dir for use by app images.
|
|
|
|
COPY ./src/ubuntu/install/maximize_script $STARTUPDIR/
|
|
|
|
|
2022-04-06 15:29:07 +02:00
|
|
|
### Install custom fonts
|
|
|
|
COPY ./src/ubuntu/install/fonts $INST_SCRIPTS/fonts/
|
|
|
|
RUN bash $INST_SCRIPTS/fonts/install_custom_fonts.sh && rm -rf $INST_SCRIPTS/fonts/
|
|
|
|
|
|
|
|
### Install xfce UI
|
|
|
|
COPY ./src/ubuntu/install/xfce $INST_SCRIPTS/xfce/
|
|
|
|
RUN bash $INST_SCRIPTS/xfce/install_xfce_ui.sh && rm -rf $INST_SCRIPTS/xfce/
|
|
|
|
COPY ./src/$DISTRO/xfce/.config/ $HOME/.config/
|
|
|
|
COPY /src/common/resources/images/bg_kasm.png /usr/share/backgrounds/bg_kasm.png
|
|
|
|
COPY /src/common/resources/images/$BG_IMG /usr/share/backgrounds/bg_default.png
|
|
|
|
|
|
|
|
### Install kasm_vnc dependencies and binaries
|
|
|
|
COPY ./src/ubuntu/install/kasm_vnc $INST_SCRIPTS/kasm_vnc/
|
|
|
|
RUN bash $INST_SCRIPTS/kasm_vnc/install_kasm_vnc.sh && rm -rf $INST_SCRIPTS/kasm_vnc/
|
2022-10-12 14:30:11 +02:00
|
|
|
COPY ./src/common/install/kasm_vnc/kasmvnc.yaml /etc/kasmvnc/
|
2022-04-06 15:29:07 +02:00
|
|
|
|
2023-06-28 22:16:30 +02:00
|
|
|
### Install Kasm Profile Sync
|
|
|
|
COPY ./src/ubuntu/install/profile_sync $INST_SCRIPTS/profile_sync/
|
|
|
|
RUN bash $INST_SCRIPTS/profile_sync/install_profile_sync.sh
|
|
|
|
|
2022-04-06 15:29:07 +02:00
|
|
|
### Install Kasm Upload Server
|
|
|
|
COPY ./src/ubuntu/install/kasm_upload_server $INST_SCRIPTS/kasm_upload_server/
|
|
|
|
RUN bash $INST_SCRIPTS/kasm_upload_server/install_kasm_upload_server.sh && rm -rf $INST_SCRIPTS/kasm_upload_server/
|
|
|
|
|
|
|
|
### Install custom cursors
|
|
|
|
COPY ./src/ubuntu/install/cursors $INST_SCRIPTS/cursors/
|
|
|
|
RUN bash $INST_SCRIPTS/cursors/install_cursors.sh && rm -rf $INST_SCRIPTS/cursors/
|
|
|
|
|
|
|
|
### Install Audio
|
|
|
|
COPY ./src/ubuntu/install/audio $INST_SCRIPTS/audio/
|
|
|
|
RUN bash $INST_SCRIPTS/audio/install_audio.sh && rm -rf $INST_SCRIPTS/audio/
|
|
|
|
|
|
|
|
### Install Audio Input
|
|
|
|
COPY ./src/ubuntu/install/audio_input $INST_SCRIPTS/audio_input/
|
|
|
|
RUN bash $INST_SCRIPTS/audio_input/install_audio_input.sh && rm -rf $INST_SCRIPTS/audio_input/
|
|
|
|
|
2022-08-02 20:33:01 +02:00
|
|
|
### Install Gamepad Service
|
|
|
|
COPY ./src/ubuntu/install/gamepad $INST_SCRIPTS/gamepad/
|
|
|
|
RUN bash $INST_SCRIPTS/gamepad/install_gamepad.sh && rm -rf $INST_SCRIPTS/gamepad/
|
|
|
|
|
2023-03-24 20:12:03 +01:00
|
|
|
### Install Webcam Service
|
|
|
|
COPY ./src/ubuntu/install/webcam $INST_SCRIPTS/webcam/
|
|
|
|
RUN bash $INST_SCRIPTS/webcam/install_webcam.sh && rm -rf $INST_SCRIPTS/webcam/
|
|
|
|
|
2023-12-23 00:12:10 +01:00
|
|
|
### Install Printer Service
|
2023-07-25 15:54:41 +02:00
|
|
|
COPY ./src/ubuntu/install/printer $INST_SCRIPTS/printer/
|
|
|
|
COPY ./src/ubuntu/install/printer/start_cups.sh /etc/cups/start_cups.sh
|
|
|
|
RUN bash $INST_SCRIPTS/printer/install_printer.sh && rm -rf $INST_SCRIPTS/printer
|
|
|
|
COPY ./src/ubuntu/install/printer/resources/*.ppd /etc/cups/ppd/
|
|
|
|
|
2023-12-23 00:12:10 +01:00
|
|
|
### Install Recorder Service
|
|
|
|
COPY ./src/ubuntu/install/recorder $INST_SCRIPTS/recorder/
|
|
|
|
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
|
|
|
|
2022-04-06 15:29:07 +02:00
|
|
|
### Copy built Squid
|
|
|
|
COPY --from=squid_builder /usr/local/squid /usr/local/squid
|
|
|
|
|
|
|
|
### Install Squid
|
|
|
|
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
|
|
|
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
|
|
|
COPY ./src/ubuntu/install/squid/resources/*.conf /etc/squid/
|
|
|
|
COPY ./src/ubuntu/install/squid/resources/start_squid.sh /etc/squid/start_squid.sh
|
|
|
|
COPY ./src/ubuntu/install/squid/resources/SN.png /usr/local/squid/share/icons/SN.png
|
|
|
|
RUN chown proxy:proxy /usr/local/squid/share/icons/SN.png
|
|
|
|
COPY ./src/ubuntu/install/squid/resources/error_message/access_denied.html /usr/local/squid/share/errors/en/ERR_ACCESS_DENIED
|
|
|
|
RUN chown proxy:proxy /usr/local/squid/share/errors/en/ERR_ACCESS_DENIED
|
|
|
|
RUN rm -rf "$INST_SCRIPTS/resources/"
|
|
|
|
|
|
|
|
RUN chmod +x /etc/squid/kasm_squid_adapter
|
|
|
|
RUN chmod +x /etc/squid/start_squid.sh && chmod 4755 /etc/squid/start_squid.sh
|
|
|
|
|
|
|
|
### configure startup
|
|
|
|
COPY ./src/common/scripts/kasm_hook_scripts $STARTUPDIR
|
|
|
|
COPY ./src/common/startup_scripts $STARTUPDIR
|
2022-05-13 20:19:59 +02:00
|
|
|
RUN bash $STARTUPDIR/set_user_permission.sh $STARTUPDIR $HOME && \
|
|
|
|
echo 'source $STARTUPDIR/generate_container_user' >> $HOME/.bashrc
|
2022-04-06 15:29:07 +02:00
|
|
|
|
|
|
|
### extra configurations needed per distro variant
|
|
|
|
COPY ./src/ubuntu/install/extra $INST_SCRIPTS/extra/
|
|
|
|
RUN bash $INST_SCRIPTS/extra/$EXTRA_SH && rm -rf $INST_SCRIPTS/extra/
|
|
|
|
|
2023-05-11 03:21:47 +02:00
|
|
|
### Sysbox support
|
|
|
|
COPY ./src/ubuntu/install/sysbox $INST_SCRIPTS/sysbox/
|
|
|
|
RUN bash $INST_SCRIPTS/sysbox/install_systemd.sh && rm -rf $INST_SCRIPTS/sysbox/
|
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
### Custom Folder Emblems
|
|
|
|
COPY ./src/ubuntu/install/emblems $INST_SCRIPTS/emblems/
|
|
|
|
RUN bash $INST_SCRIPTS/emblems/install_emblems.sh && rm -rf $INST_SCRIPTS/emblems/
|
|
|
|
|
2024-07-04 00:36:43 +02:00
|
|
|
### Egress Icons
|
|
|
|
RUN mkdir -p /usr/share/extra/icons/
|
|
|
|
ADD /src/common/resources/images/egress_info.svg /usr/share/extra/icons/egress_info.svg
|
|
|
|
ADD /src/common/resources/images/egress_error.svg /usr/share/extra/icons/egress_error.svg
|
|
|
|
ADD /src/common/resources/images/egress_offline.svg /usr/share/extra/icons/egress_offline.svg
|
|
|
|
|
2022-05-13 20:19:59 +02:00
|
|
|
### Create user and home directory for base images that don't already define it
|
|
|
|
RUN (groupadd -g 1000 kasm-user \
|
|
|
|
&& useradd -M -u 1000 -g 1000 kasm-user \
|
|
|
|
&& usermod -a -G kasm-user kasm-user) ; exit 0
|
2022-04-06 15:29:07 +02:00
|
|
|
ENV HOME /home/kasm-user
|
|
|
|
WORKDIR $HOME
|
|
|
|
RUN mkdir -p $HOME && chown -R 1000:0 $HOME
|
|
|
|
|
2023-12-23 00:12:10 +01:00
|
|
|
### Create user exclusively for session recording purposes
|
|
|
|
RUN (groupadd -g 1001 kasm-recorder \
|
|
|
|
&& useradd -M -u 1001 -g 1001 kasm-recorder \
|
|
|
|
&& usermod -a -G kasm-recorder) ; exit 0
|
|
|
|
|
2022-04-06 15:29:07 +02:00
|
|
|
### FIX PERMISSIONS ## Objective is to change the owner of non-home paths to root, remove write permissions, and set execute where required
|
|
|
|
# these files are created on container first exec, by the default user, so we have to create them since default will not have write perm
|
|
|
|
RUN touch $STARTUPDIR/wm.log \
|
|
|
|
&& touch $STARTUPDIR/window_manager_startup.log \
|
|
|
|
&& touch $STARTUPDIR/vnc_startup.log \
|
|
|
|
&& touch $STARTUPDIR/no_vnc_startup.log \
|
|
|
|
&& chown -R root:root $STARTUPDIR \
|
|
|
|
&& find $STARTUPDIR -type d -exec chmod 755 {} \; \
|
|
|
|
&& find $STARTUPDIR -type f -exec chmod 644 {} \; \
|
|
|
|
&& find $STARTUPDIR -type f -iname "*.sh" -exec chmod 755 {} \; \
|
|
|
|
&& find $STARTUPDIR -type f -iname "*.py" -exec chmod 755 {} \; \
|
|
|
|
&& find $STARTUPDIR -type f -iname "*.rb" -exec chmod 755 {} \; \
|
|
|
|
&& find $STARTUPDIR -type f -iname "*.pl" -exec chmod 755 {} \; \
|
|
|
|
&& find $STARTUPDIR -type f -iname "*.log" -exec chmod 666 {} \; \
|
|
|
|
&& chmod 755 $STARTUPDIR/upload_server/kasm_upload_server \
|
|
|
|
&& chmod 755 $STARTUPDIR/audio_input/kasm_audio_input_server \
|
2022-08-02 20:33:01 +02:00
|
|
|
&& chmod 755 $STARTUPDIR/gamepad/kasm_gamepad_server \
|
2023-03-24 20:12:03 +01:00
|
|
|
&& chmod 755 $STARTUPDIR/webcam/kasm_webcam_server \
|
2022-04-06 15:29:07 +02:00
|
|
|
&& chmod 755 $STARTUPDIR/generate_container_user \
|
2023-08-01 20:37:29 +02:00
|
|
|
&& chmod 755 $STARTUPDIR/printer/kasm_printer_service \
|
2023-12-23 00:12:10 +01:00
|
|
|
&& chmod 755 $STARTUPDIR/recorder/kasm_recorder_service \
|
2022-04-06 15:29:07 +02:00
|
|
|
&& chmod +x $STARTUPDIR/jsmpeg/kasm_audio_out-linux \
|
|
|
|
&& rm -rf $STARTUPDIR/install \
|
|
|
|
&& mkdir -p $STARTUPDIR/kasmrx/Downloads \
|
|
|
|
&& chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \
|
2022-04-06 19:15:22 +02:00
|
|
|
&& chown -R root:root /usr/local/bin \
|
|
|
|
&& chown 1000:root /var/run/pulse
|
2022-04-06 15:29:07 +02:00
|
|
|
|
2023-04-25 04:55:48 +02:00
|
|
|
### Cleanup job
|
|
|
|
COPY ./src/ubuntu/install/cleanup $INST_SCRIPTS/cleanup/
|
|
|
|
RUN bash $INST_SCRIPTS/cleanup/cleanup.sh && rm -rf $INST_SCRIPTS/cleanup/
|
|
|
|
|
|
|
|
#### Runtime Stage ####
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=base_layer / /
|
|
|
|
|
|
|
|
### Labels
|
|
|
|
LABEL "org.opencontainers.image.authors"='Kasm Tech "info@kasmweb.com"'
|
|
|
|
LABEL "com.kasmweb.image"="true"
|
|
|
|
|
|
|
|
### Environment config
|
|
|
|
ARG DISTRO=oracle8
|
|
|
|
ARG EXTRA_SH=noop.sh
|
|
|
|
ARG LANG='en_US.UTF-8'
|
|
|
|
ARG LANGUAGE='en_US:en'
|
|
|
|
ARG LC_ALL='en_US.UTF-8'
|
|
|
|
ARG START_PULSEAUDIO=1
|
|
|
|
ARG START_XFCE4=1
|
2023-07-19 19:24:16 +02:00
|
|
|
ARG TZ='Etc/UTC'
|
2023-04-25 04:55:48 +02:00
|
|
|
ENV AUDIO_PORT=4901 \
|
|
|
|
DISPLAY=:1 \
|
|
|
|
DISTRO=$DISTRO \
|
|
|
|
GOMP_SPINCOUNT=0 \
|
|
|
|
HOME=/home/kasm-user \
|
|
|
|
INST_SCRIPTS=/dockerstartup/install \
|
|
|
|
KASMVNC_AUTO_RECOVER=true \
|
|
|
|
KASM_VNC_PATH=/usr/share/kasmvnc \
|
|
|
|
LANG=$LANG \
|
|
|
|
LANGUAGE=$LANGUAGE \
|
|
|
|
LC_ALL=$LC_ALL \
|
|
|
|
LD_LIBRARY_PATH=/usr/local/lib/ \
|
|
|
|
MAX_FRAME_RATE=24 \
|
|
|
|
NO_VNC_PORT=6901 \
|
|
|
|
NVIDIA_DRIVER_CAPABILITIES=${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics,compat32,utility \
|
|
|
|
OMP_WAIT_POLICY=PASSIVE \
|
|
|
|
PULSE_RUNTIME_PATH=/var/run/pulse \
|
|
|
|
SDL_GAMECONTROLLERCONFIG="030000005e040000be02000014010000,XInput Controller,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b8,guide:b16,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:b12,dpdown:b13,dpleft:b14,dpright:b15,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7" \
|
|
|
|
SHELL=/bin/bash \
|
|
|
|
START_PULSEAUDIO=$START_PULSEAUDIO \
|
|
|
|
STARTUPDIR=/dockerstartup \
|
|
|
|
START_XFCE4=$START_XFCE4 \
|
|
|
|
TERM=xterm \
|
|
|
|
VNC_COL_DEPTH=24 \
|
|
|
|
VNCOPTIONS="-PreferBandwidth -DynamicQualityMin=4 -DynamicQualityMax=7 -DLP_ClipDelay=0" \
|
|
|
|
VNC_PORT=5901 \
|
|
|
|
VNC_PORT=5901 \
|
|
|
|
VNC_PW=vncpassword \
|
|
|
|
VNC_RESOLUTION=1280x1024 \
|
|
|
|
VNC_RESOLUTION=1280x720 \
|
2023-07-19 19:24:16 +02:00
|
|
|
VNC_VIEW_ONLY_PW=vncviewonlypassword \
|
|
|
|
TZ=$TZ
|
2023-04-25 04:55:48 +02:00
|
|
|
|
|
|
|
### Ports and user
|
|
|
|
EXPOSE $VNC_PORT \
|
|
|
|
$NO_VNC_PORT \
|
|
|
|
$UPLOAD_PORT \
|
|
|
|
$AUDIO_PORT
|
|
|
|
WORKDIR $HOME
|
2022-04-06 15:29:07 +02:00
|
|
|
USER 1000
|
|
|
|
|
|
|
|
ENTRYPOINT ["/dockerstartup/kasm_default_profile.sh", "/dockerstartup/vnc_startup.sh", "/dockerstartup/kasm_startup.sh"]
|
|
|
|
CMD ["--wait"]
|