Skip to content

Commit 343b1a0

Browse files
Switching to gitpod/workspace-base
1 parent ab721ae commit 343b1a0

2 files changed

Lines changed: 46 additions & 34 deletions

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ on:
1313

1414

1515
env:
16-
BASE_IMAGE_VERSION: 3.15.0
16+
FETCHER_IMAGE_VERSION: 3.15.0
17+
BASE_IMAGE_VERSION: commit-f2d623ca9d270c2ce8560d2ca0f9ce71b105aff2 # See https://hub.docker.com/r/gitpod/workspace-base/tags
1718

1819
# NOTE: DO NOT CHANGE THIS IS TMP IMAGE NAME
1920
IMAGE_NAME: image
@@ -48,7 +49,11 @@ jobs:
4849
- uses: actions/checkout@v2
4950

5051
- name: Build image
51-
run: docker build --build-arg BASE_IMAGE_VERSION=${BASE_IMAGE_VERSION} . --file Dockerfile --tag $IMAGE_NAME
52+
run: |
53+
docker build . \
54+
--build-arg FETCHER_IMAGE_VERSION=${FETCHER_IMAGE_VERSION} \
55+
--build-arg BASE_IMAGE_VERSION=${BASE_IMAGE_VERSION} \
56+
--file Dockerfile --tag $IMAGE_NAME
5257
5358
- name: Log into GitHub Container Registry
5459
# TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT`

Dockerfile

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
ARG BASE_IMAGE_VERSION
1+
# ARG FETCHER_IMAGE_VERSION=3.15.0
2+
# ARG BASE_IMAGE_VERSION=commit-f2d623ca9d270c2ce8560d2ca0f9ce71b105aff2
23

34
# Based on https://github.com/gitpod-io/workspace-images/blob/master/base/Dockerfile and https://github.com/gitpod-io/workspace-images/blob/master/full/Dockerfile
45

5-
FROM alpine:${BASE_IMAGE_VERSION} as FETCHER
6+
FROM alpine:${FETCHER_IMAGE_VERSION} as FETCHER
7+
8+
RUN apk --no-cache add unzip
69

710
USER root
811

9-
ARG KUSTOMIZE_VERSION=v4.4.1
10-
ARG KUSTIMIZE_HELM_PLUGIN=v0.9.2
12+
ENV KUSTOMIZE_VERSION=v4.4.1
13+
ENV KUSTIMIZE_HELM_PLUGIN=v0.9.2
14+
ENV STARSHIP_VERSION=v1.1.1
15+
ENV DOCKER_VERSION=20.10.9
1116

1217
RUN mkdir /tmp/completion
1318

@@ -18,53 +23,55 @@ RUN kustomize completion zsh > /tmp/completion/_kustomize
1823

1924
# Khelm https://github.com/mgoltzsche/khelm
2025
RUN mkdir -p /root/.config/kustomize/plugin/helm.kustomize.mgoltzsche.github.com/v1/chartrenderer && \
21-
wget -O- https://github.com/mgoltzsche/helm-kustomize-plugin/releases/download/${KUSTIMIZE_HELM_PLUGIN}/helm-kustomize-plugin > /root/.config/kustomize/plugin/helm.kustomize.mgoltzsche.github.com/v1/chartrenderer/ChartRenderer && \
22-
chmod u+x /root/.config/kustomize/plugin/helm.kustomize.mgoltzsche.github.com/v1/chartrenderer/ChartRenderer
26+
wget -O- https://github.com/mgoltzsche/helm-kustomize-plugin/releases/download/${KUSTIMIZE_HELM_PLUGIN}/helm-kustomize-plugin > /root/.config/kustomize/plugin/helm.kustomize.mgoltzsche.github.com/v1/chartrenderer/ChartRenderer && \
27+
chmod u+x /root/.config/kustomize/plugin/helm.kustomize.mgoltzsche.github.com/v1/chartrenderer/ChartRenderer
2328

2429
# Gosu https://github.com/tianon/gosu/blob/master/hub/Dockerfile.alpine
2530
# TODO
2631

2732
ADD https://raw.githubusercontent.com/perlpunk/shell-completions/6af9f7cd5db837680aef453ca6ded1a3dd219eae/zsh/_jq /tmp/completion/_jq
2833

34+
# Starship https://github.com/starship/starship
35+
RUN wget -O- https://github.com/starship/starship/releases/download/${STARSHIP_VERSION}/starship-x86_64-unknown-linux-gnu.tar.gz | tar xvz -C /usr/local/bin/
36+
RUN chmod +x /usr/local/bin/starship
37+
38+
# Docker https://github.com/moby/moby
39+
RUN wget -O- https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz | tar xvz -C /usr/local/bin/
40+
RUN chmod +x /usr/local/bin/docker
41+
42+
# AWS CLI
43+
RUN wget https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip
44+
RUN unzip awscli-exe-linux-x86_64.zip -d /tmp
45+
RUN /tmp/aws/install --bin-dir /tmp/aws-cli-bin
2946

3047
RUN chmod 644 /tmp/completion/*
3148

32-
FROM alpine:${BASE_IMAGE_VERSION}
49+
################################################
50+
FROM gitpod/workspace-base:${BASE_IMAGE_VERSION}
51+
52+
ENV RUN_AS_USER=gitpod
3353

3454
USER root
35-
ARG RUN_AS_USER=gitpod
36-
ENV LANG=en_US.UTF-8
37-
38-
### Packages ###
39-
RUN apk add --no-cache \
40-
zsh \
41-
git \
42-
curl \
43-
make \
44-
jq \
45-
python3 \
46-
py3-pip \
47-
docker \
48-
starship \
49-
terraform \
50-
musl \
51-
libc6-compat \
52-
libgcc \
53-
libstdc++
55+
56+
## Packages ###
57+
RUN apt-get update && apt-get install -y \
58+
python3-pip \
59+
docker.io \
60+
&& rm -rf /var/lib/apt/lists/*
5461

5562
### PIP ###
5663
RUN pip3 install --no-cache-dir awscli
5764

58-
### Gitpod user ###
59-
RUN adduser --disabled-password --shell /bin/zsh --uid 33333 ${RUN_AS_USER}
60-
61-
ENV HOME=/home/gitpod
62-
WORKDIR $HOME
63-
6465
COPY --from=FETCHER /usr/local/bin/kustomize /usr/local/bin/kustomize
6566
COPY --from=FETCHER /tmp/completion/_kustomize /usr/share/zsh/site-functions/_kustomize
6667
COPY --from=FETCHER /root/.config/kustomize/plugin/helm.kustomize.mgoltzsche.github.com/v1/chartrenderer/ChartRenderer /home/${RUN_AS_USER}/.config/kustomize/plugin/helm.kustomize.mgoltzsche.github.com/v1/chartrenderer/ChartRenderer
6768
COPY --from=FETCHER /tmp/completion/_jq /usr/share/zsh/site-functions/_jq
69+
COPY --from=FETCHER /usr/local/bin/starship /usr/local/bin/starship
70+
COPY --from=FETCHER /usr/local/bin/docker/docker /usr/local/bin/docker
71+
COPY --from=FETCHER /usr/local/aws-cli/ /usr/local/aws-cli/
72+
COPY --from=FETCHER /tmp/aws-cli-bin/ /usr/local/bin/
73+
74+
RUN chsh -s /usr/bin/zsh ${RUN_AS_USER}
6875

6976
USER gitpod
7077

0 commit comments

Comments
 (0)