Skip to content

Commit

Permalink
Add support for version 1.0.9 of vscode-kubernetes-tools (che-dockerf…
Browse files Browse the repository at this point in the history
…iles#4)

This PR updates the Dockerfile to use helm 3, which is needed
in order to upgrade to version 1.0.9 of vscode-kubernetes-tools.

See eclipse-che/che#15190

Signed-off-by: Eric Williams <ericwill@redhat.com>
  • Loading branch information
ericwill authored and nickboldt committed Feb 7, 2020
1 parent eb92c9d commit 6c8772d
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019 Red Hat, Inc.
# Copyright (c) 2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand All @@ -12,7 +12,7 @@ name: Build and push container
on:
push:
branches:
- '1.0.4'
- '1.0.9'

jobs:
build:
Expand Down
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation

FROM quay.io/buildah/stable:v1.11.3

ENV KUBECTL_VERSION v1.17.0
ENV HELM_VERSION v3.0.2
ENV HOME=/home/theia

ADD etc/storage.conf $HOME/.config/containers/storage.conf

RUN mkdir /projects && \
# Change permissions to let any arbitrary user
for f in "${HOME}" "/etc/passwd" "/projects"; do \
echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
chmod -R g+rwX ${f}; \
done && \
# buildah login requires writing to /run
chgrp -R 0 /run && chmod -R g+rwX /run && \
curl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && \
chmod +x /usr/local/bin/kubectl && \
curl -o- -L https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz | tar xvz -C /usr/local/bin --strip 1 && \
# 'which' utility is used by VS Code Kubernetes extension to find the binaries, e.g. 'kubectl'
dnf install -y which nodejs

ADD etc/entrypoint.sh /entrypoint.sh

ENTRYPOINT [ "/entrypoint.sh" ]
CMD ${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}
29 changes: 29 additions & 0 deletions etc/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
#
# Copyright (c) 2018-2018 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

set -e

export USER_ID=$(id -u)
export GROUP_ID=$(id -g)

if ! whoami >/dev/null 2>&1; then
echo "${USER_NAME:-user}:x:${USER_ID}:0:${USER_NAME:-user} user:${HOME}:/bin/sh" >> /etc/passwd
fi

# Grant access to projects volume in case of non root user with sudo rights
if [ "${USER_ID}" -ne 0 ] && command -v sudo >/dev/null 2>&1 && sudo -n true > /dev/null 2>&1; then
sudo chown "${USER_ID}:${GROUP_ID}" /projects
fi

exec "$@"

31 changes: 31 additions & 0 deletions etc/storage.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[storage]
driver = "overlay"
runroot = "/var/tmp/theia"
graphroot = "/home/theia/.local/share/containers/storage"
[storage.options]
size = ""
remap-uids = ""
remap-gids = ""
ignore_chown_errors = "true"
remap-user = ""
remap-group = ""
ostree_repo = ""
skip_mount_home = ""
mount_program = "/usr/bin/fuse-overlayfs"
mountopt = ""
[storage.options.thinpool]
autoextend_percent = ""
autoextend_threshold = ""
basesize = ""
blocksize = ""
directlvm_device = ""
directlvm_device_force = ""
fs = ""
log_level = ""
min_free_space = ""
mkfsarg = ""
mountopt = ""
use_deferred_deletion = ""
use_deferred_removal = ""
xfs_nospace_max_retries = ""

0 comments on commit 6c8772d

Please sign in to comment.