-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.base
49 lines (39 loc) · 1.66 KB
/
Dockerfile.base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -----------------------------------------------
# Build Showroom Terminal Base Image
# -----------------------------------------------
FROM --platform=linux/amd64 registry.access.redhat.com/ubi9:latest
ARG TTYD_VERSION="1.7.4"
ARG TINI_VERSION="0.19.0"
ARG BUILD_DATE="2023-12-11"
LABEL maintainer="Wolfgang Kulhanek - [email protected]" \
build-date=$BUILD_DATE
USER root
# Install base software
RUN dnf -y update && dnf -y upgrade && \
dnf -y install wget vim unzip git procps bash-completion httpd-tools jq && \
dnf -y install https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}-amd64.rpm && \
dnf clean all && \
rm -rf /var/cache/yum /root/.cache && \
wget -q -O /usr/bin/ttyd https://github.com/tsl0922/ttyd/releases/download/${TTYD_VERSION}/ttyd.i686
# Create a user to be used in the terminal
RUN adduser lab-user --home-dir=/home/lab-user && \
mkdir /var/lab-user && \
chown lab-user:root /var/lab-user
COPY assets/bashrc.base /var/lab-user/bashrc.base
COPY assets/runttyd /usr/bin/runttyd
COPY assets/motd /etc/motd.d/rhdp
# Set image up to be run as random user on OpenShift
RUN chown lab-user:root /var/lab-user/bashrc.base && \
chown root:root /usr/bin/ttyd /usr/bin/runttyd /etc/motd.d/rhdp && \
chmod u=rwx,g=rwx,o=rx /usr/bin/ttyd /usr/bin/runttyd && \
chmod u=rx,g=rx,o=r /etc/motd.d/rhdp && \
chown -R lab-user:root /home/lab-user && \
chmod 770 /home/lab-user && \
chgrp 0 /home/lab-user && \
chmod -R g=u /home/lab-user /etc/passwd
USER lab-user
WORKDIR /home/lab-user
VOLUME /home/lab-user
EXPOSE 7681
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/usr/bin/runttyd"]