From 85fc27487352a1af00fec68819c592dbd92c79b2 Mon Sep 17 00:00:00 2001 From: Will O'Beirne Date: Mon, 19 Oct 2020 18:10:23 -0500 Subject: [PATCH] Create a set of base images for all other images to use (#13) * Create a set of base images that other images use to reduce duplication * Use docker driver to allow using locally built and cached images * Add lsb-release, ca-certificates, and locales (or equivalent packages) to base images * Add pip3 to ubuntu --- .github/workflows/ci.yaml | 58 ++++++++++++++++++++++++++++ README.md | 15 +++++++ bin/ci-template.yaml | 2 + bin/generate-actions-yaml.sh | 20 ++++++++-- images/base/Dockerfile.arch | 25 ++++++++++++ images/base/Dockerfile.centos | 27 +++++++++++++ images/base/Dockerfile.ubuntu | 23 +++++++++++ images/goland/Dockerfile.centos | 26 ++----------- images/goland/Dockerfile.ubuntu | 27 ++----------- images/intellij/Dockerfile.centos | 26 ++----------- images/intellij/Dockerfile.ubuntu | 27 ++----------- images/jupyter/Dockerfile.centos | 18 ++------- images/jupyter/Dockerfile.ubuntu | 23 ++--------- images/multieditor/Dockerfile.centos | 17 ++++++++ images/multieditor/Dockerfile.ubuntu | 15 +++++++ images/pycharm/Dockerfile.centos | 26 ++----------- images/pycharm/Dockerfile.ubuntu | 27 ++----------- images/webstorm/Dockerfile.centos | 26 ++----------- images/webstorm/Dockerfile.ubuntu | 27 ++----------- 19 files changed, 239 insertions(+), 216 deletions(-) create mode 100644 images/base/Dockerfile.arch create mode 100644 images/base/Dockerfile.centos create mode 100644 images/base/Dockerfile.ubuntu create mode 100644 images/multieditor/Dockerfile.centos create mode 100644 images/multieditor/Dockerfile.ubuntu diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index af0195b..08d4350 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,6 +19,8 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + with: + driver: docker - name: Cache Docker layers uses: actions/cache@v2 @@ -33,6 +35,51 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push - codercom/enterprise-base:arch + uses: docker/build-push-action@v2 + with: + context: ./images/base + file: ./images/base/Dockerfile.arch + tags: codercom/enterprise-base:arch + push: ${{ github.event_name != 'pull_request' }} + load: true + - + name: Build and push - codercom/enterprise-base:centos + uses: docker/build-push-action@v2 + with: + context: ./images/base + file: ./images/base/Dockerfile.centos + tags: codercom/enterprise-base:centos + push: ${{ github.event_name != 'pull_request' }} + load: true + - + name: Build and push - codercom/enterprise-base:ubuntu + uses: docker/build-push-action@v2 + with: + context: ./images/base + file: ./images/base/Dockerfile.ubuntu + tags: codercom/enterprise-base:ubuntu + push: ${{ github.event_name != 'pull_request' }} + load: true + - + name: Build and push - codercom/enterprise-multieditor:centos + uses: docker/build-push-action@v2 + with: + context: ./images/multieditor + file: ./images/multieditor/Dockerfile.centos + tags: codercom/enterprise-multieditor:centos + push: ${{ github.event_name != 'pull_request' }} + load: true + - + name: Build and push - codercom/enterprise-multieditor:ubuntu + uses: docker/build-push-action@v2 + with: + context: ./images/multieditor + file: ./images/multieditor/Dockerfile.ubuntu + tags: codercom/enterprise-multieditor:ubuntu + push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-configure:ubuntu uses: docker/build-push-action@v2 @@ -41,6 +88,7 @@ jobs: file: ./images/configure/Dockerfile.ubuntu tags: codercom/enterprise-configure:ubuntu push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-goland:centos uses: docker/build-push-action@v2 @@ -49,6 +97,7 @@ jobs: file: ./images/goland/Dockerfile.centos tags: codercom/enterprise-goland:centos push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-goland:ubuntu uses: docker/build-push-action@v2 @@ -57,6 +106,7 @@ jobs: file: ./images/goland/Dockerfile.ubuntu tags: codercom/enterprise-goland:ubuntu push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-intellij:centos uses: docker/build-push-action@v2 @@ -65,6 +115,7 @@ jobs: file: ./images/intellij/Dockerfile.centos tags: codercom/enterprise-intellij:centos push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-intellij:ubuntu uses: docker/build-push-action@v2 @@ -73,6 +124,7 @@ jobs: file: ./images/intellij/Dockerfile.ubuntu tags: codercom/enterprise-intellij:ubuntu push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-jupyter:centos uses: docker/build-push-action@v2 @@ -81,6 +133,7 @@ jobs: file: ./images/jupyter/Dockerfile.centos tags: codercom/enterprise-jupyter:centos push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-jupyter:ubuntu uses: docker/build-push-action@v2 @@ -89,6 +142,7 @@ jobs: file: ./images/jupyter/Dockerfile.ubuntu tags: codercom/enterprise-jupyter:ubuntu push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-pycharm:centos uses: docker/build-push-action@v2 @@ -97,6 +151,7 @@ jobs: file: ./images/pycharm/Dockerfile.centos tags: codercom/enterprise-pycharm:centos push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-pycharm:ubuntu uses: docker/build-push-action@v2 @@ -105,6 +160,7 @@ jobs: file: ./images/pycharm/Dockerfile.ubuntu tags: codercom/enterprise-pycharm:ubuntu push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-webstorm:centos uses: docker/build-push-action@v2 @@ -113,6 +169,7 @@ jobs: file: ./images/webstorm/Dockerfile.centos tags: codercom/enterprise-webstorm:centos push: ${{ github.event_name != 'pull_request' }} + load: true - name: Build and push - codercom/enterprise-webstorm:ubuntu uses: docker/build-push-action@v2 @@ -121,3 +178,4 @@ jobs: file: ./images/webstorm/Dockerfile.ubuntu tags: codercom/enterprise-webstorm:ubuntu push: ${{ github.event_name != 'pull_request' }} + load: true diff --git a/README.md b/README.md index 889d2cb..49075f0 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,21 @@ with different IDEs. See our [documentation at our Enterprise Hub](https://enterprise.coder.com/docs/multi-editor) for additional information about supported editors and known issues. +## Image Minimums + +All of the images provided in this repo include the following utilities to ensure they work well +with all of Coder Enterprise's features, and to provide a solid out-of-the-box developer experience: + +* git +* bash +* curl & wget +* htop +* man +* vim +* sudo +* python3 & pip3 +* gcc & gcc-c++ & make + ## Images on Docker Hub Each of these images is also published to Docker Hub under the `codercom/enterprise-[name]` diff --git a/bin/ci-template.yaml b/bin/ci-template.yaml index 30c2309..de43160 100644 --- a/bin/ci-template.yaml +++ b/bin/ci-template.yaml @@ -18,6 +18,8 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + with: + driver: docker - name: Cache Docker layers uses: actions/cache@v2 diff --git a/bin/generate-actions-yaml.sh b/bin/generate-actions-yaml.sh index 8ebcbfc..95de0ea 100755 --- a/bin/generate-actions-yaml.sh +++ b/bin/generate-actions-yaml.sh @@ -4,6 +4,9 @@ set -euo pipefail CI_TEMPLATE="bin/ci-template.yaml" CI_FILE=".github/workflows/ci.yaml" +# Some images need to build before others, everything else can go in any order +ORDERED_IMAGES=("base" "multieditor") + function copyTemplate() { rm -rf $CI_FILE echo -e "# File generated by bin/generate-actions-yaml.sh\n$(cat $CI_TEMPLATE)" > $CI_FILE @@ -21,6 +24,7 @@ function appendAction() { echo " file: ./images/$image/Dockerfile.$tag" echo " tags: codercom/enterprise-$image:$tag" echo " push: \${{ github.event_name != 'pull_request' }}" + echo " load: true" } >> $CI_FILE } @@ -31,9 +35,19 @@ function main() { # Create template yaml copyTemplate - # Add an action per Dockerfile - image_dirs=$(ls images) - for image in ${image_dirs[@]}; do + # Add actions for building each image, maintaining desired image order + image_dirs=($(ls images)) + all_images=("${ORDERED_IMAGES[@]}" "${image_dirs[@]}") + seen_images=() + + for image in ${all_images[@]}; do + # Skip image if we've already seen it, duplicates come from ORDERED_IMAGES + if [[ "${seen_images[@]}" =~ "${image}" ]]; then + continue + fi + seen_images+=("$image") + + # Create action per dockerfile dockerfiles=$(ls images/$image/Dockerfile*) for dockerfile in ${dockerfiles}; do tag=${dockerfile##*.} diff --git a/images/base/Dockerfile.arch b/images/base/Dockerfile.arch new file mode 100644 index 0000000..a47d4f0 --- /dev/null +++ b/images/base/Dockerfile.arch @@ -0,0 +1,25 @@ +FROM archlinux/base + +SHELL ["/bin/bash", "-c"] + +# Install baseline packages +RUN pacman --noconfirm -Syu \ + base \ + base-devel \ + git \ + bash \ + curl \ + wget \ + htop \ + man \ + vim \ + sudo \ + python3 \ + openssh \ + lsb-release \ + ca-certificates + +# Add coder user. +RUN useradd -mUs /bin/bash coder && \ + echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +USER coder diff --git a/images/base/Dockerfile.centos b/images/base/Dockerfile.centos new file mode 100644 index 0000000..7c17863 --- /dev/null +++ b/images/base/Dockerfile.centos @@ -0,0 +1,27 @@ +FROM centos:8 + +# Add the EPEL repolist +RUN yum -y install epel-release +RUN yum repolist + +# Install baseline packages +RUN yum update -y && yum install -y \ + gcc \ + gcc-c++ \ + make \ + git \ + bash \ + curl \ + wget \ + htop \ + man \ + vim \ + sudo \ + python3 \ + redhat-lsb-core \ + ca-certificates + +# Add a user `coder` so that you're not developing as the `root` user +RUN adduser coder && \ + echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +USER coder diff --git a/images/base/Dockerfile.ubuntu b/images/base/Dockerfile.ubuntu new file mode 100644 index 0000000..9e411f0 --- /dev/null +++ b/images/base/Dockerfile.ubuntu @@ -0,0 +1,23 @@ +FROM ubuntu:20.04 + +# Install baseline packages +RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \ + build-essential \ + git \ + bash \ + curl \ + wget \ + htop \ + man \ + vim \ + sudo \ + python3 \ + python3-pip \ + lsb-release \ + ca-certificates \ + locales + +# Add a user `coder` so that you're not developing as the `root` user +RUN adduser --gecos '' --disabled-password coder && \ + echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +USER coder diff --git a/images/goland/Dockerfile.centos b/images/goland/Dockerfile.centos index c5832b7..4c6cf79 100644 --- a/images/goland/Dockerfile.centos +++ b/images/goland/Dockerfile.centos @@ -1,23 +1,7 @@ -FROM centos:8 +FROM codercom/enterprise-multieditor:centos -RUN yum update -y && yum install -y \ - which \ - git \ - bash \ - curl \ - man \ - vim \ - sudo \ - gnupg \ - # The following libraries are required for the IDE to be able to communicate with - # code-server through xserver messaging. - openssl \ - libXtst \ - libXrender \ - fontconfig \ - libXi \ - gtk3 \ - libGL +# Run everything as root +USER root # Install goland. RUN mkdir -p /opt/goland @@ -26,7 +10,5 @@ RUN curl -L "https://download.jetbrains.com/product?code=GO&latest&distribution= # Add a binary to the PATH that points to the goland startup script. RUN ln -s /opt/goland/bin/goland.sh /usr/bin/goland -# Add a user `coder` so that you're not developing as the `root` user -RUN adduser coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +# Set back to coder user USER coder diff --git a/images/goland/Dockerfile.ubuntu b/images/goland/Dockerfile.ubuntu index 459e860..362a19e 100644 --- a/images/goland/Dockerfile.ubuntu +++ b/images/goland/Dockerfile.ubuntu @@ -1,24 +1,7 @@ -FROM ubuntu:20.04 +FROM codercom/enterprise-multieditor:ubuntu -RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \ - git \ - bash \ - curl \ - htop \ - man \ - vim \ - ssh \ - sudo \ - lsb-release \ - ca-certificates \ - locales \ - gnupg \ - # Packages required for multi-editor support - libxtst6 \ - libxrender1 \ - libfontconfig1 \ - libxi6 \ - libgtk-3-0 +# Run everything as root +USER root # Install goland. RUN mkdir -p /opt/goland @@ -27,7 +10,5 @@ RUN curl -L "https://download.jetbrains.com/product?code=GO&latest&distribution= # Add a binary to the PATH that points to the goland startup script. RUN ln -s /opt/goland/bin/goland.sh /usr/bin/goland -# Add a user `coder` so that you're not developing as the `root` user -RUN adduser --gecos '' --disabled-password coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +# Set back to coder user USER coder diff --git a/images/intellij/Dockerfile.centos b/images/intellij/Dockerfile.centos index dddc13d..d3d5994 100644 --- a/images/intellij/Dockerfile.centos +++ b/images/intellij/Dockerfile.centos @@ -1,23 +1,7 @@ -FROM centos:8 +FROM codercom/enterprise-multieditor:centos -RUN yum update -y && yum install -y \ - which \ - git \ - bash \ - curl \ - man \ - vim \ - sudo \ - gnupg \ - # The following libraries are required for the IDE to be able to communicate with - # code-server through xserver messaging. - openssl \ - libXtst \ - libXrender \ - fontconfig \ - libXi \ - gtk3 \ - libGL +# Run everything as root +USER root # Install intellij. RUN mkdir -p /opt/idea @@ -26,7 +10,5 @@ RUN curl -L "https://download.jetbrains.com/product?code=IIC&latest&distribution # Add a binary to the PATH that points to the intellij startup script. RUN ln -s /opt/idea/bin/idea.sh /usr/bin/intellij-idea-ultimate -# Add a user `coder` so that you're not developing as the `root` user -RUN adduser coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +# Set back to coder user USER coder diff --git a/images/intellij/Dockerfile.ubuntu b/images/intellij/Dockerfile.ubuntu index 2b0518b..0db73e0 100644 --- a/images/intellij/Dockerfile.ubuntu +++ b/images/intellij/Dockerfile.ubuntu @@ -1,24 +1,7 @@ -FROM ubuntu:20.04 +FROM codercom/enterprise-multieditor:ubuntu -RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \ - git \ - bash \ - curl \ - htop \ - man \ - vim \ - ssh \ - sudo \ - lsb-release \ - ca-certificates \ - locales \ - gnupg \ - # Packages required for multi-editor support - libxtst6 \ - libxrender1 \ - libfontconfig1 \ - libxi6 \ - libgtk-3-0 +# Run everything as root +USER root # Install intellij. RUN mkdir -p /opt/idea @@ -27,7 +10,5 @@ RUN curl -L "https://download.jetbrains.com/product?code=IIC&latest&distribution # Add a binary to the PATH that points to the intellij startup script. RUN ln -s /opt/idea/bin/idea.sh /usr/bin/intellij-idea-community -# Add a user `coder` so that you're not developing as the `root` user -RUN adduser --gecos '' --disabled-password coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +# Set back to coder user USER coder diff --git a/images/jupyter/Dockerfile.centos b/images/jupyter/Dockerfile.centos index 25c3de1..1186859 100644 --- a/images/jupyter/Dockerfile.centos +++ b/images/jupyter/Dockerfile.centos @@ -1,20 +1,10 @@ -FROM centos:8 +FROM codercom/enterprise-base:centos -RUN yum update -y && yum install -y \ - which \ - git \ - bash \ - curl \ - man \ - vim \ - sudo \ - gnupg \ - python36 +# Run everything as root +USER root # Install jupyter RUN pip3 install jupyterlab -# Add a user `coder` so that you're not developing as the `root` user -RUN adduser coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +# Set back to coder user USER coder diff --git a/images/jupyter/Dockerfile.ubuntu b/images/jupyter/Dockerfile.ubuntu index 8818f02..ea56ea7 100644 --- a/images/jupyter/Dockerfile.ubuntu +++ b/images/jupyter/Dockerfile.ubuntu @@ -1,25 +1,10 @@ -FROM ubuntu:20.04 +FROM codercom/enterprise-base:ubuntu -RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \ - git \ - bash \ - curl \ - htop \ - man \ - vim \ - ssh \ - sudo \ - lsb-release \ - ca-certificates \ - locales \ - gnupg \ - python3 \ - python3-pip +# Run everything as root +USER root # Install jupyter RUN pip3 install jupyterlab -# Add a user `coder` so that you're not developing as the `root` user -RUN adduser --gecos '' --disabled-password coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +# Set back to coder user USER coder diff --git a/images/multieditor/Dockerfile.centos b/images/multieditor/Dockerfile.centos new file mode 100644 index 0000000..eb1d323 --- /dev/null +++ b/images/multieditor/Dockerfile.centos @@ -0,0 +1,17 @@ +FROM codercom/enterprise-base:centos + +# Run everything as root +USER root + +# Packages required for multi-editor support +RUN yum update -y && yum install -y \ + openssl \ + libXtst \ + libXrender \ + fontconfig \ + libXi \ + gtk3 \ + libGL + +# Set back to coder user +USER coder diff --git a/images/multieditor/Dockerfile.ubuntu b/images/multieditor/Dockerfile.ubuntu new file mode 100644 index 0000000..b144570 --- /dev/null +++ b/images/multieditor/Dockerfile.ubuntu @@ -0,0 +1,15 @@ +FROM codercom/enterprise-base:ubuntu + +# Run everything as root +USER root + +# Packages required for multi-editor support +RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y \ + libxtst6 \ + libxrender1 \ + libfontconfig1 \ + libxi6 \ + libgtk-3-0 + +# Set back to coder user +USER coder diff --git a/images/pycharm/Dockerfile.centos b/images/pycharm/Dockerfile.centos index 9758380..6c4368f 100644 --- a/images/pycharm/Dockerfile.centos +++ b/images/pycharm/Dockerfile.centos @@ -1,23 +1,7 @@ -FROM centos:8 +FROM codercom/enterprise-multieditor:centos -RUN yum update -y && yum install -y \ - which \ - git \ - bash \ - curl \ - man \ - vim \ - sudo \ - gnupg \ - # The following libraries are required for the IDE to be able to communicate with - # code-server through xserver messaging. - openssl \ - libXtst \ - libXrender \ - fontconfig \ - libXi \ - gtk3 \ - libGL +# Run everything as root +USER root # Install pycharm. RUN mkdir -p /opt/pycharm @@ -26,7 +10,5 @@ RUN curl -L "https://download.jetbrains.com/product?code=PCC&latest&distribution # Add a binary to the PATH that points to the pycharm startup script. RUN ln -s /opt/pycharm/bin/pycharm.sh /usr/bin/pycharm -# Add a user `coder` so that you're not developing as the `root` user -RUN adduser coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +# Set back to coder user USER coder diff --git a/images/pycharm/Dockerfile.ubuntu b/images/pycharm/Dockerfile.ubuntu index 8a6f585..ecb22ab 100644 --- a/images/pycharm/Dockerfile.ubuntu +++ b/images/pycharm/Dockerfile.ubuntu @@ -1,24 +1,7 @@ -FROM ubuntu:20.04 +FROM codercom/enterprise-multieditor:ubuntu -RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \ - git \ - bash \ - curl \ - htop \ - man \ - vim \ - ssh \ - sudo \ - lsb-release \ - ca-certificates \ - locales \ - gnupg \ - # Packages required for multi-editor support - libxtst6 \ - libxrender1 \ - libfontconfig1 \ - libxi6 \ - libgtk-3-0 +# Run everything as root +USER root # Install pycharm. RUN mkdir -p /opt/pycharm @@ -27,7 +10,5 @@ RUN curl -L "https://download.jetbrains.com/product?code=PCC&latest&distribution # Add a binary to the PATH that points to the pycharm startup script. RUN ln -s /opt/pycharm/bin/pycharm.sh /usr/bin/pycharm -# Add a user `coder` so that you're not developing as the `root` user -RUN adduser --gecos '' --disabled-password coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +# Set back to coder user USER coder diff --git a/images/webstorm/Dockerfile.centos b/images/webstorm/Dockerfile.centos index adddc77..cef1617 100644 --- a/images/webstorm/Dockerfile.centos +++ b/images/webstorm/Dockerfile.centos @@ -1,23 +1,7 @@ -FROM centos:8 +FROM codercom/enterprise-multieditor:centos -RUN yum update -y && yum install -y \ - which \ - git \ - bash \ - curl \ - man \ - vim \ - sudo \ - gnupg \ - # The following libraries are required for the IDE to be able to communicate with - # code-server through xserver messaging. - openssl \ - libXtst \ - libXrender \ - fontconfig \ - libXi \ - gtk3 \ - libGL +# Run everything as root +USER root # Install webstorm. RUN mkdir -p /opt/webstorm @@ -26,7 +10,5 @@ RUN curl -L "https://download.jetbrains.com/product?code=WS&latest&distribution= # Add a binary to the PATH that points to the webstorm startup script. RUN ln -s /opt/webstorm/bin/webstorm.sh /usr/bin/webstorm -# Add a user `coder` so that you're not developing as the `root` user -RUN adduser coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +# Set back to coder user USER coder diff --git a/images/webstorm/Dockerfile.ubuntu b/images/webstorm/Dockerfile.ubuntu index 93e294a..d187595 100644 --- a/images/webstorm/Dockerfile.ubuntu +++ b/images/webstorm/Dockerfile.ubuntu @@ -1,24 +1,7 @@ -FROM ubuntu:20.04 +FROM codercom/enterprise-multieditor:ubuntu -RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \ - git \ - bash \ - curl \ - htop \ - man \ - vim \ - ssh \ - sudo \ - lsb-release \ - ca-certificates \ - locales \ - gnupg \ - # Packages required for multi-editor support - libxtst6 \ - libxrender1 \ - libfontconfig1 \ - libxi6 \ - libgtk-3-0 +# Run everything as root +USER root # Install webstorm. RUN mkdir -p /opt/webstorm @@ -27,7 +10,5 @@ RUN curl -L "https://download.jetbrains.com/product?code=WS&latest&distribution= # Add a binary to the PATH that points to the webstorm startup script. RUN ln -s /opt/webstorm/bin/webstorm.sh /usr/bin/webstorm -# Add a user `coder` so that you're not developing as the `root` user -RUN adduser --gecos '' --disabled-password coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd +# Set back to coder user USER coder