From 0c0cdd4667d4160b4a664cb387a04a5e1964b5fa Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Thu, 8 Sep 2022 15:56:33 -0400 Subject: [PATCH 1/4] KASM-3187 add jammy dind images --- .gitlab-ci.yml | 8 ++- dockerfile-kasm-ubuntu-jammy-dind | 59 ++++++++++++++++ dockerfile-kasm-ubuntu-jammy-dind-rootless | 67 +++++++++++++++++++ docs/ubuntu-jammy-dind-rootless/README.md | 13 ++++ .../description.txt | 1 + docs/ubuntu-jammy-dind/README.md | 13 ++++ docs/ubuntu-jammy-dind/description.txt | 1 + src/ubuntu/install/chrome/install_chrome.sh | 1 + 8 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 dockerfile-kasm-ubuntu-jammy-dind create mode 100644 dockerfile-kasm-ubuntu-jammy-dind-rootless create mode 100644 docs/ubuntu-jammy-dind-rootless/README.md create mode 100644 docs/ubuntu-jammy-dind-rootless/description.txt create mode 100644 docs/ubuntu-jammy-dind/README.md create mode 100644 docs/ubuntu-jammy-dind/description.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d4e717c..398830a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,6 +39,8 @@ variables: .MULTI_ARCH_BUILDS2: &MULTI_ARCH_BUILDS2 - vivaldi + - ubuntu-jammy-dind + - ubuntu-jammy-dind-rootless .SINGLE_ARCH_BUILDS: &SINGLE_ARCH_BUILDS - atom @@ -166,7 +168,7 @@ build_ubuntu_desktop_images: - aws-autoscale parallel: matrix: - - KASM_IMAGE: [desktop, desktop-deluxe, ubuntu-focal-desktop, ubuntu-jammy-desktop, ubuntu-focal-dind, ubuntu-focal-dind-rootless] + - KASM_IMAGE: [desktop, desktop-deluxe, ubuntu-focal-desktop, ubuntu-jammy-desktop, ubuntu-focal-dind, ubuntu-focal-dind-rootless, ubuntu-jammy-dind, ubuntu-jammy-dind-rootless] build_non_ubuntu: stage: build @@ -559,7 +561,7 @@ build_schedules_ubuntu_desktop_images: - aws-autoscale parallel: matrix: - - KASM_IMAGE: [desktop, desktop-deluxe, ubuntu-focal-desktop, ubuntu-jammy-desktop, ubuntu-focal-dind, ubuntu-focal-dind-rootless] + - KASM_IMAGE: [desktop, desktop-deluxe, ubuntu-focal-desktop, ubuntu-jammy-desktop, ubuntu-focal-dind, ubuntu-focal-dind-rootless, ubuntu-jammy-dind, ubuntu-jammy-dind-rootless] build_schedules_non_ubuntu: image: ${ORG_NAME}/docker-buildx-private:develop @@ -710,3 +712,5 @@ update_readmes2: matrix: - KASM_IMAGE: - vivaldi + - ubuntu-jammy-dind + - ubuntu-jammy-dind-rootless diff --git a/dockerfile-kasm-ubuntu-jammy-dind b/dockerfile-kasm-ubuntu-jammy-dind new file mode 100644 index 0000000..ddb7c40 --- /dev/null +++ b/dockerfile-kasm-ubuntu-jammy-dind @@ -0,0 +1,59 @@ +ARG BASE_TAG="develop" +ARG BASE_IMAGE="core-ubuntu-jammy" +FROM kasmweb/$BASE_IMAGE:$BASE_TAG +USER root + +ENV HOME /home/kasm-default-profile +ENV STARTUPDIR /dockerstartup +ENV INST_SCRIPTS $STARTUPDIR/install +WORKDIR $HOME + +######### Customize Container Here ########### + +ENV DOCKER_CHANNEL=stable \ + DOCKER_VERSION=20.10.9 \ + DOCKER_COMPOSE_VERSION=1.29.2 \ + DEBUG=false + +COPY ./src/ubuntu/install/dind $INST_SCRIPTS/dind/ +COPY ./src/ubuntu/install/dind/daemon.json /etc/docker/daemon.json + +RUN bash $INST_SCRIPTS/dind/install_dind.sh && rm -rf $INST_SCRIPTS/dind/ + +COPY ./src/ubuntu/install/dind/custom_startup.sh $STARTUPDIR/custom_startup.sh +RUN chmod +x $STARTUPDIR/custom_startup.sh +RUN chmod 755 $STARTUPDIR/custom_startup.sh + +COPY ./src/ubuntu/install/dind/modprobe /usr/local/bin/modprobe +RUN chmod +x /usr/local/bin/modprobe +COPY ./src/ubuntu/install/dind/dockerd.conf /etc/supervisor/conf.d/ + +### Install Tools +COPY ./src/ubuntu/install/tools $INST_SCRIPTS/tools/ +RUN bash $INST_SCRIPTS/tools/install_tools_deluxe.sh && rm -rf $INST_SCRIPTS/tools/ + +# Install Utilities +COPY ./src/ubuntu/install/misc $INST_SCRIPTS/misc/ +RUN bash $INST_SCRIPTS/misc/install_tools.sh && rm -rf $INST_SCRIPTS/misc/ + +### Install Sublime Text +COPY ./src/ubuntu/install/sublime_text $INST_SCRIPTS/sublime_text/ +RUN bash $INST_SCRIPTS/sublime_text/install_sublime_text.sh && rm -rf $INST_SCRIPTS/sublime_text/ + +### Install Visual Studio Code +COPY ./src/ubuntu/install/vs_code $INST_SCRIPTS/vs_code/ +RUN bash $INST_SCRIPTS/vs_code/install_vs_code.sh && rm -rf $INST_SCRIPTS/vs_code/ + +# Install Google Chrome +COPY ./src/ubuntu/install/chrome $INST_SCRIPTS/chrome/ +RUN bash $INST_SCRIPTS/chrome/install_chrome.sh && rm -rf $INST_SCRIPTS/chrome/ + +######### End Customizations ########### + +RUN chown 1000:0 $HOME + +ENV HOME /home/kasm-user +WORKDIR $HOME +RUN mkdir -p $HOME && chown -R 1000:0 $HOME + +USER 1000 diff --git a/dockerfile-kasm-ubuntu-jammy-dind-rootless b/dockerfile-kasm-ubuntu-jammy-dind-rootless new file mode 100644 index 0000000..363bd31 --- /dev/null +++ b/dockerfile-kasm-ubuntu-jammy-dind-rootless @@ -0,0 +1,67 @@ +ARG BASE_TAG="develop" +ARG BASE_IMAGE="core-ubuntu-jammy" +FROM kasmweb/$BASE_IMAGE:$BASE_TAG +USER root + +ENV HOME /home/kasm-default-profile +ENV STARTUPDIR /dockerstartup +ENV INST_SCRIPTS $STARTUPDIR/install +WORKDIR $HOME + +######### Customize Container Here ########### + +ENV DOCKER_BIN=/usr/local/lib/docker \ + XDG_RUNTIME_DIR=/docker + +RUN mkdir -p $DOCKER_BIN && chown 1000:0 $DOCKER_BIN && \ + mkdir -p $XDG_RUNTIME_DIR && chown 1000:0 $XDG_RUNTIME_DIR + +ENV PATH=$DOCKER_BIN:$DOCKER_BIN/cli-plugins:$PATH \ + DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock + +COPY ./src/ubuntu/install/dind_rootless/install_dind_rootless_prerequisites.sh $INST_SCRIPTS/dind_rootless/ +RUN bash $INST_SCRIPTS/dind_rootless/install_dind_rootless_prerequisites.sh + +COPY ./src/ubuntu/install/dind_rootless/install_dind_rootless.sh $INST_SCRIPTS/dind_rootless/ +RUN chown 1000:1000 $INST_SCRIPTS/dind_rootless/install_dind_rootless.sh +# It's recommended that docker-rootless be installed by non root user +USER 1000 +RUN bash $INST_SCRIPTS/dind_rootless/install_dind_rootless.sh +USER root +RUN rm -rf $INST_SCRIPTS/dind_rootless + +COPY ./src/ubuntu/install/dind_rootless/custom_startup.sh $STARTUPDIR/custom_startup.sh +RUN chmod +x $STARTUPDIR/custom_startup.sh && chmod 755 $STARTUPDIR/custom_startup.sh + +COPY ./src/ubuntu/install/dind_rootless/modprobe /usr/local/bin/modprobe +RUN chmod +x /usr/local/bin/modprobe + +### Install Tools +COPY ./src/ubuntu/install/tools $INST_SCRIPTS/tools/ +RUN bash $INST_SCRIPTS/tools/install_tools_deluxe.sh && rm -rf $INST_SCRIPTS/tools/ + +# Install Utilities +COPY ./src/ubuntu/install/misc $INST_SCRIPTS/misc/ +RUN bash $INST_SCRIPTS/misc/install_tools.sh && rm -rf $INST_SCRIPTS/misc/ + +### Install Sublime Text +COPY ./src/ubuntu/install/sublime_text $INST_SCRIPTS/sublime_text/ +RUN bash $INST_SCRIPTS/sublime_text/install_sublime_text.sh && rm -rf $INST_SCRIPTS/sublime_text/ + +### Install Visual Studio Code +COPY ./src/ubuntu/install/vs_code $INST_SCRIPTS/vs_code/ +RUN bash $INST_SCRIPTS/vs_code/install_vs_code.sh && rm -rf $INST_SCRIPTS/vs_code/ + +# Install Google Chrome +COPY ./src/ubuntu/install/chrome $INST_SCRIPTS/chrome/ +RUN bash $INST_SCRIPTS/chrome/install_chrome.sh && rm -rf $INST_SCRIPTS/chrome/ + +######### End Customizations ########### + +RUN chown 1000:0 $HOME + +ENV HOME /home/kasm-user +WORKDIR $HOME +RUN mkdir -p $HOME && chown -R 1000:0 $HOME + +USER 1000 diff --git a/docs/ubuntu-jammy-dind-rootless/README.md b/docs/ubuntu-jammy-dind-rootless/README.md new file mode 100644 index 0000000..5e7bc79 --- /dev/null +++ b/docs/ubuntu-jammy-dind-rootless/README.md @@ -0,0 +1,13 @@ +# About This Image + +This Image contains a browser-accessible version of [Docker](https://www.docker.com/) running as a normal, non-root user. + +![Screenshot][Image_Screenshot] + +[Image_Screenshot]: https://5856039.fs1.hubspotusercontent-na1.net/hubfs/5856039/dockerhub/image-screenshots/ubuntu-jammy-dind-rootless.png "Image Screenshot" + +See [Kasm Docs](https://kasmweb.com/docs/latest/how_to/docker_in_kasm.html) for additional setup instructions. + +# Environment Variables + +* `APP_ARGS` - Additional arguments to pass to the application when launched. diff --git a/docs/ubuntu-jammy-dind-rootless/description.txt b/docs/ubuntu-jammy-dind-rootless/description.txt new file mode 100644 index 0000000..f976460 --- /dev/null +++ b/docs/ubuntu-jammy-dind-rootless/description.txt @@ -0,0 +1 @@ +Rootless Docker for Kasm Workspaces \ No newline at end of file diff --git a/docs/ubuntu-jammy-dind/README.md b/docs/ubuntu-jammy-dind/README.md new file mode 100644 index 0000000..dff8028 --- /dev/null +++ b/docs/ubuntu-jammy-dind/README.md @@ -0,0 +1,13 @@ +# About This Image + +This Image contains a browser-accessible version of [Docker](https://www.docker.com/). + +![Screenshot][Image_Screenshot] + +[Image_Screenshot]: https://5856039.fs1.hubspotusercontent-na1.net/hubfs/5856039/dockerhub/image-screenshots/ubuntu-jammy-dind.png "Image Screenshot" + +See [Kasm Docs](https://kasmweb.com/docs/latest/how_to/docker_in_kasm.html) for additional setup instructions. + +# Environment Variables + +* `APP_ARGS` - Additional arguments to pass to the application when launched. diff --git a/docs/ubuntu-jammy-dind/description.txt b/docs/ubuntu-jammy-dind/description.txt new file mode 100644 index 0000000..3f8c02c --- /dev/null +++ b/docs/ubuntu-jammy-dind/description.txt @@ -0,0 +1 @@ +Docker for Kasm Workspaces \ No newline at end of file diff --git a/src/ubuntu/install/chrome/install_chrome.sh b/src/ubuntu/install/chrome/install_chrome.sh index 17f26b3..fa5cdc7 100644 --- a/src/ubuntu/install/chrome/install_chrome.sh +++ b/src/ubuntu/install/chrome/install_chrome.sh @@ -47,6 +47,7 @@ sed -i 's/-stable//g' /usr/share/applications/google-chrome.desktop cp /usr/share/applications/google-chrome.desktop $HOME/Desktop/ chown 1000:1000 $HOME/Desktop/google-chrome.desktop +chmod +x $HOME/Desktop/google-chrome.desktop mv /usr/bin/google-chrome /usr/bin/google-chrome-orig cat >/usr/bin/google-chrome < Date: Thu, 8 Sep 2022 15:58:47 -0400 Subject: [PATCH 2/4] KASM-3187 wrong column dind images are single arch --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 398830a..352f406 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,8 +39,6 @@ variables: .MULTI_ARCH_BUILDS2: &MULTI_ARCH_BUILDS2 - vivaldi - - ubuntu-jammy-dind - - ubuntu-jammy-dind-rootless .SINGLE_ARCH_BUILDS: &SINGLE_ARCH_BUILDS - atom @@ -65,6 +63,8 @@ variables: - tracelabs - ubuntu-focal-dind - ubuntu-focal-dind-rootless + - ubuntu-jammy-dind + - ubuntu-jammy-dind-rootless - unityhub - zoom - zsnes From ffc3c1d5092bbdf227373d9fa4cdab79973f2f7f Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Thu, 8 Sep 2022 16:17:55 -0400 Subject: [PATCH 3/4] KASM-3188 create codecs directory manually --- src/ubuntu/install/vivaldi/install_vivaldi.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ubuntu/install/vivaldi/install_vivaldi.sh b/src/ubuntu/install/vivaldi/install_vivaldi.sh index bae318c..decd2d8 100644 --- a/src/ubuntu/install/vivaldi/install_vivaldi.sh +++ b/src/ubuntu/install/vivaldi/install_vivaldi.sh @@ -7,6 +7,7 @@ VIVALDI_ARGS="--password-store=basic --no-sandbox --ignore-gpu-blocklist --user- wget -qO- https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor > /usr/share/keyrings/vivaldi-browser.gpg echo "deb [signed-by=/usr/share/keyrings/vivaldi-browser.gpg arch=$(dpkg --print-architecture)] https://repo.vivaldi.com/archive/deb/ stable main" > /etc/apt/sources.list.d/vivaldi-archive.list apt-get update && apt-get install -y vivaldi-stable +mkdir -p /var/opt/vivaldi /opt/vivaldi/update-ffmpeg # Add Desktop Icon From 1b41b891cd4ce35b1ad145acf5c9d2ab5b83136f Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Mon, 12 Sep 2022 16:30:11 -0400 Subject: [PATCH 4/4] KASM-3187 ensure correct base image is being used for jammy dind images --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 352f406..9835a48 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -156,6 +156,8 @@ build_ubuntu_desktop_images: - ls docs/$KASM_IMAGE/description.txt # Check for private variable to build against private core images - if [[ $KASM_IMAGE =~ 'ubuntu-jammy-desktop' ]]; then CORE_IMAGE=core-ubuntu-jammy; fi + - if [[ $KASM_IMAGE =~ 'ubuntu-jammy-dind' ]]; then CORE_IMAGE=core-ubuntu-jammy; fi + - if [[ $KASM_IMAGE =~ 'ubuntu-jammy-dind-rootless' ]]; then CORE_IMAGE=core-ubuntu-jammy; fi - if [[ $USE_PRIVATE_IMAGES -eq 1 ]]; then CORE_IMAGE=$CORE_IMAGE-private; fi; - docker buildx build --push --platform $BUILD_PLATFORM -t ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_BRANCH -t ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_ROLLING_BRANCH -t ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_BRANCH -t ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_ROLLING_BRANCH --build-arg BASE_IMAGE=$CORE_IMAGE --build-arg BASE_TAG=$CORE_IMAGE_TAG -f dockerfile-kasm-$KASM_IMAGE . @@ -287,6 +289,8 @@ build_single_arch_dev: - if [[ $KASM_IMAGE =~ 'oracle-8-desktop' ]]; then CORE_IMAGE=core-oracle-8; fi - if [[ $KASM_IMAGE =~ 'opensuse-15-desktop' ]]; then CORE_IMAGE=core-opensuse-15; fi - if [[ $KASM_IMAGE =~ 'ubuntu-jammy-desktop' ]]; then CORE_IMAGE=core-ubuntu-jammy; fi + - if [[ $KASM_IMAGE =~ 'ubuntu-jammy-dind' ]]; then CORE_IMAGE=core-ubuntu-jammy; fi + - if [[ $KASM_IMAGE =~ 'ubuntu-jammy-dind-rootless' ]]; then CORE_IMAGE=core-ubuntu-jammy; fi # Check for private variable to build against private core images - if [[ $USE_PRIVATE_IMAGES -eq 1 ]]; then CORE_IMAGE=$CORE_IMAGE-private; fi; - > @@ -550,6 +554,8 @@ build_schedules_ubuntu_desktop_images: - ls docs/$KASM_IMAGE/description.txt # Check for private variable to build against private core images - if [[ $KASM_IMAGE =~ 'ubuntu-jammy-desktop' ]]; then CORE_IMAGE=core-ubuntu-jammy; fi + - if [[ $KASM_IMAGE =~ 'ubuntu-jammy-dind' ]]; then CORE_IMAGE=core-ubuntu-jammy; fi + - if [[ $KASM_IMAGE =~ 'ubuntu-jammy-dind-rootless' ]]; then CORE_IMAGE=core-ubuntu-jammy; fi - if [[ $USE_PRIVATE_IMAGES -eq 1 ]]; then CORE_IMAGE=$CORE_IMAGE-private; fi; # Equivalent to docker build and docker push. Builds amd64 natively uses qemu for arm64.