diff --git a/.circleci/config.yml b/.circleci/config.yml index a708320..fa4de82 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.0 jobs: - workspace-full: + debian-workspace-full: docker: - image: csweichel/dazzle:latest steps: @@ -9,9 +9,8 @@ jobs: - setup_remote_docker - run: command: | - chmod 777 ./.circleci/dazzle_build_image.sh - chmod 777 ./.circleci/build_image.sh - ./.circleci/dazzle_build_image.sh custom-images/ubuntu/gp-workspace-full/Dockerfile madebythepinshub/gp-workspace-full workspace-full.tar + chmod 777 startDockerBuild.sh + ./startDockerBuild custom-images/debian/gp-workspace-full/Dockerfile madebythepinsteam/gp-workspace-full --dazzle madebythepinsteam/gp-workspace-full.tar no_output_timeout: 30m - run: name: Save test results @@ -32,4 +31,4 @@ workflows: version: 2 build-and-deploy: jobs: - - workspace-full + - debian-workspace-full diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f17193..fd0ac40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ # Changelog History -We're not yet wrote any changelog here. To see what changed in real-time, see the commit history. +## Current - WIP + +* Renamed repo to `custom-gp-workspaces` since `sudo` are now available under an feature flag in Gitpod.io. diff --git a/README.md b/README.md index c750776..0a78d42 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ -# Custom Gitpod Workspace Images with `sudo` +# Custom Gitpod Workspace Images We build customized Gitpod Workspace images for your need, with `sudo` access. We had -to browow stuff from [the official Git repository](https://github.com/gitpod-io/workspace-images) -and configure these images bsed on what we need. +to borrow stuff from [the official Git repository](https://github.com/gitpod-io/workspace-images) +and configure these images bsed on what we need. PRs are welcome! + +Please be reminded that these are currently WIP, so use with caution. ## Installation diff --git a/custom-images/debian/.gitkeep b/custom-images/debian/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/custom-images/ubuntu/gp-workspace-full/Dockerfile b/custom-images/gp-workspace-full/Dockerfile similarity index 89% rename from custom-images/ubuntu/gp-workspace-full/Dockerfile rename to custom-images/gp-workspace-full/Dockerfile index faac597..95c33cd 100644 --- a/custom-images/ubuntu/gp-workspace-full/Dockerfile +++ b/custom-images/gp-workspace-full/Dockerfile @@ -1,38 +1,66 @@ -## Copied from https://github.com/gitpod-io/workspace-images/blob/master/full/Dockerfile -## And then customized based on our needs - -FROM buildpack-deps:focal +FROM buildpack-deps:buster ### base ### -RUN yes | unminimize \ - && apt-get install -yq \ - zip \ - unzip \ - bash-completion \ - build-essential \ - htop \ - jq \ - less \ - locales \ - man-db \ - nano \ - software-properties-common \ - sudo \ - time \ - vim \ - multitail \ - lsof \ - && locale-gen en_US.UTF-8 \ - && mkdir /var/lib/apt/dazzle-marks \ - && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* +RUN set -ex; \ + apt-get update; \ +# make sure debconf doesn't try to prompt (e.g. tzdata on Ubuntu) + DEBIAN_FRONTEND=noninteractive \ + apt-get install -y --no-install-recommends \ + autoconf \ + automake \ + bzip2 \ + dpkg-dev \ + file \ + g++ \ + gcc \ + imagemagick \ + libbz2-dev \ + libc6-dev \ + libcurl4-openssl-dev \ + libdb-dev \ + libevent-dev \ + libffi-dev \ + libgdbm-dev \ + libglib2.0-dev \ + libgmp-dev \ + libjpeg-dev \ + libkrb5-dev \ + liblzma-dev \ + libmagickcore-dev \ + libmagickwand-dev \ + libmaxminddb-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libpng-dev \ + libpq-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + libtool \ + libwebp-dev \ + libxml2-dev \ + libxslt-dev \ + libyaml-dev \ + make \ + patch \ + unzip \ + xz-utils \ + zlib1g-dev \ + \ +# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html + $( \ +# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep + if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ + echo 'default-libmysqlclient-dev'; \ + else \ + echo 'libmysqlclient-dev'; \ + fi \ + ) \ + ; \ + rm -rf /var/lib/apt/lists/* ENV LANG=en_US.UTF-8 -### Install Git ### -RUN add-apt-repository -y ppa:git-core/ppa \ - && apt-get install -yq git \ - && rm -rf /var/lib/apt/lists/* - ### Create an generic Gitpod user ### RUN useradd -l -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \ && echo "gitpod:gitpod" | chpasswd diff --git a/custom-images/ubuntu/gp-workspace-full/apache2/apache2.conf b/custom-images/gp-workspace-full/apache2/apache2.conf similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/apache2/apache2.conf rename to custom-images/gp-workspace-full/apache2/apache2.conf diff --git a/custom-images/ubuntu/gp-workspace-full/apache2/envvars b/custom-images/gp-workspace-full/apache2/envvars similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/apache2/envvars rename to custom-images/gp-workspace-full/apache2/envvars diff --git a/custom-images/ubuntu/gp-workspace-full/ngnix/ngnix.conf b/custom-images/gp-workspace-full/ngnix/ngnix.conf similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/ngnix/ngnix.conf rename to custom-images/gp-workspace-full/ngnix/ngnix.conf diff --git a/custom-images/ubuntu/gp-workspace-full/nvm-lazy.sh b/custom-images/gp-workspace-full/nvm-lazy.sh similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/nvm-lazy.sh rename to custom-images/gp-workspace-full/nvm-lazy.sh diff --git a/custom-images/ubuntu/gp-workspace-full/tests/lang-c.yaml b/custom-images/gp-workspace-full/tests/lang-c.yaml similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/tests/lang-c.yaml rename to custom-images/gp-workspace-full/tests/lang-c.yaml diff --git a/custom-images/ubuntu/gp-workspace-full/tests/lang-go.yaml b/custom-images/gp-workspace-full/tests/lang-go.yaml similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/tests/lang-go.yaml rename to custom-images/gp-workspace-full/tests/lang-go.yaml diff --git a/custom-images/ubuntu/gp-workspace-full/tests/lang-java.yaml b/custom-images/gp-workspace-full/tests/lang-java.yaml similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/tests/lang-java.yaml rename to custom-images/gp-workspace-full/tests/lang-java.yaml diff --git a/custom-images/ubuntu/gp-workspace-full/tests/lang-node.yaml b/custom-images/gp-workspace-full/tests/lang-node.yaml similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/tests/lang-node.yaml rename to custom-images/gp-workspace-full/tests/lang-node.yaml diff --git a/custom-images/ubuntu/gp-workspace-full/tests/lang-php.yaml b/custom-images/gp-workspace-full/tests/lang-php.yaml similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/tests/lang-php.yaml rename to custom-images/gp-workspace-full/tests/lang-php.yaml diff --git a/custom-images/ubuntu/gp-workspace-full/tests/lang-python.yaml b/custom-images/gp-workspace-full/tests/lang-python.yaml similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/tests/lang-python.yaml rename to custom-images/gp-workspace-full/tests/lang-python.yaml diff --git a/custom-images/ubuntu/gp-workspace-full/tests/lang-ruby.yaml b/custom-images/gp-workspace-full/tests/lang-ruby.yaml similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/tests/lang-ruby.yaml rename to custom-images/gp-workspace-full/tests/lang-ruby.yaml diff --git a/custom-images/ubuntu/gp-workspace-full/tests/lang-rust.yaml b/custom-images/gp-workspace-full/tests/lang-rust.yaml similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/tests/lang-rust.yaml rename to custom-images/gp-workspace-full/tests/lang-rust.yaml diff --git a/custom-images/ubuntu/gp-workspace-full/tests/prologue.yaml b/custom-images/gp-workspace-full/tests/prologue.yaml similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/tests/prologue.yaml rename to custom-images/gp-workspace-full/tests/prologue.yaml diff --git a/custom-images/ubuntu/gp-workspace-full/tests/tool-brew.yaml b/custom-images/gp-workspace-full/tests/tool-brew.yaml similarity index 100% rename from custom-images/ubuntu/gp-workspace-full/tests/tool-brew.yaml rename to custom-images/gp-workspace-full/tests/tool-brew.yaml diff --git a/custom-images/ubuntu/.gitkeep b/custom-images/ubuntu/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/startDockerImageBuild.sh b/startDockerImageBuild.sh new file mode 100644 index 0000000..d849d8f --- /dev/null +++ b/startDockerImageBuild.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -xe + +usage=""" +Usage: + $0 DOCKERFILE IMAGE_NAME [ --dazzle IMAGE_NAME.tar ] + +Parameters: + DOCKERFILE Directory to your Dockerfile + IMAGE_NAME Image name to be used for this build + +Flags: + --dazzle IMAGE_NAME.tar Mandatory for exporting latest builds as tar file. +""" + +if [[ $# -ne 2 ]]; then + echo usage + exit 2 +fi + +while getopts dazzle option +do +sh ./circleci/dazzle_build_image.sh $1 $2 ${OPTARGS} +esac +done \ No newline at end of file