Skip to content

Commit

Permalink
Contribute remaining sidecar definitions to the plugin registry (#681)
Browse files Browse the repository at this point in the history
* Contribute remaining sidecar definitions to the plugin registry

README/CONTRIBUTING update will follow in a separate PR.

Part of eclipse-che/che#18217

Signed-off-by: Eric Williams <ericwill@redhat.com>

* Split PR into smaller pieces for ease of build time

Signed-off-by: Eric Williams <ericwill@redhat.com>
  • Loading branch information
ericwill committed Nov 11, 2020
1 parent 808b9e3 commit 2fcf341
Show file tree
Hide file tree
Showing 21 changed files with 298 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sidecars/camelk/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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/eclipse/che-sidecar-kubernetes-tooling:1.2.1-6144144

ENV KAMEL_VERSION 1.2.0

RUN curl -L https://github.com/apache/camel-k/releases/download/v${KAMEL_VERSION}/camel-k-client-${KAMEL_VERSION}-linux-64bit.tar.gz | tar -C /usr/local/bin -xz \
&& chmod +x /usr/local/bin/kamel

1 change: 1 addition & 0 deletions sidecars/camelk/PLATFORMS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux/amd64
29 changes: 29 additions & 0 deletions sidecars/kubernetes-tooling/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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/eclipse/che-container-tools:1.0.0-8caea0f

ENV MINIKUBE_VERSION=v1.12.1

ADD etc/storage.conf ${HOME}/.config/containers/storage.conf
ADD etc/containers.conf ${HOME}/.config/containers/containers.conf
ADD etc/subuid /etc/subuid
ADD etc/subgid /etc/subgid

RUN export ARCH_MINIKUBE="$(uname -m)" && if [[ ${ARCH_MINIKUBE} == "x86_64" ]]; then export ARCH_MINIKUBE="amd64"; elif [[ ${ARCH_MINIKUBE} == "aarch64" ]]; \
then export ARCH_MINIKUBE="arm64"; fi && \
curl https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-${ARCH_MINIKUBE} -o /usr/local/bin/minikube && \
chmod +x /usr/local/bin/minikube && \
# buildah login requires writing to /run
chgrp -R 0 /run && chmod -R g+rwX /run && \
mkdir -p /var/tmp/containers/runtime && \
chmod -R g+rwX /var/tmp/containers

ENV XDG_RUNTIME_DIR /var/tmp/containers/runtime
1 change: 1 addition & 0 deletions sidecars/kubernetes-tooling/PLATFORMS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux/amd64,linux/ppc64le,linux/s390x,linux/arm64
6 changes: 6 additions & 0 deletions sidecars/kubernetes-tooling/etc/containers.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[engine]

# Cgroup management implementation used for the runtime.
# Valid options “systemd” or “cgroupfs”
#
cgroup_manager = "cgroupfs"
10 changes: 10 additions & 0 deletions sidecars/kubernetes-tooling/etc/storage.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[storage]

# Default Storage Driver
driver = "vfs"

# Temporary storage location
runroot = "/var/tmp/containers/storage"

# Primary Read/Write location of container storage
graphroot = "/home/theia/.containers/storage"
2 changes: 2 additions & 0 deletions sidecars/kubernetes-tooling/etc/subgid
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
user:100000:65536
root:200000:65536
2 changes: 2 additions & 0 deletions sidecars/kubernetes-tooling/etc/subuid
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
user:100000:65536
root:200000:65536
23 changes: 23 additions & 0 deletions sidecars/openshift-tooling/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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/eclipse/che-container-tools:1.0.0-8caea0f

# odo and oc versions have to match the ones defined in https://github.com/redhat-developer/vscode-openshift-tools/blob/master/src/tools.json
ENV ODO_VERSION=v2.0.0 \
OC_VERSION=4.3.3

RUN curl -o- -L https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OC_VERSION}/openshift-client-linux-${OC_VERSION}.tar.gz | tar xvz -C /usr/local/bin oc && \
chmod +x /usr/local/bin/oc && \
#Set the arch
export ARCH="$(uname -m)" && if [[ ${ARCH} == "x86_64" ]]; then export ARCH="amd64"; fi && \
# install odo
curl -o /usr/local/bin/odo https://mirror.openshift.com/pub/openshift-v4/clients/odo/${ODO_VERSION}/odo-linux-${ARCH} && \
chmod +x /usr/local/bin/odo
1 change: 1 addition & 0 deletions sidecars/openshift-tooling/PLATFORMS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux/amd64,linux/ppc64le,linux/s390x
43 changes: 43 additions & 0 deletions sidecars/protobuf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2019 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 debian:10-slim

ENV HOME=/home/theia
ENV PROTOC_VERSION=3.11.2

RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install wget gnupg unzip -y && \
apt-get update && \
apt-get install -t buster-backports clangd-8 clang-8 clang-format-8 gdb -y && \
apt-get clean && apt-get -y autoremove && rm -rf /var/lib/apt/lists/* && \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100 && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 100 && \
update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-8 100 && \
update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-8 100

RUN cd /tmp && mkdir protoc-download && cd protoc-download && \
wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \
unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip && rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip && \
cp bin/protoc /usr/local/bin && mkdir /usr/include/protobuf && \
cp -R include/* /usr/include/protobuf/ && cd ../ && rm -rf protoc-download

RUN mkdir /projects ${HOME} && \
# 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

ADD etc/entrypoint.sh /entrypoint.sh

ENTRYPOINT [ "/entrypoint.sh" ]
CMD ${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}
1 change: 1 addition & 0 deletions sidecars/protobuf/PLATFORMS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux/amd64
31 changes: 31 additions & 0 deletions sidecars/protobuf/etc/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
#
# Copyright (c) 2018-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
#

set -e
set -x

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

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 "$@"
34 changes: 34 additions & 0 deletions sidecars/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) 2019 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 python:3.8.6-slim

ENV HOME=/home/theia

RUN mkdir /projects ${HOME} && \
# 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

RUN apt-get update && \
apt-get install exuberant-ctags && \
apt-get install wget -y && \
wget -O - https://deb.nodesource.com/setup_12.x | bash - && \
apt-get update && \
apt-get install nodejs gcc build-essential -y && \
pip install pylint python-language-server[all] ptvsd jedi && \
apt-get purge -y --auto-remove gcc build-essential && \
apt-get clean && apt-get -y autoremove && rm -rf /var/lib/apt/lists/*

ADD etc/entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
CMD ${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}
1 change: 1 addition & 0 deletions sidecars/python/PLATFORMS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux/amd64,linux/ppc64le,linux/s390x,linux/arm64
31 changes: 31 additions & 0 deletions sidecars/python/etc/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
#
# Copyright (c) 2018-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
#

set -e
set -x

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

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 "$@"
21 changes: 21 additions & 0 deletions sidecars/shellcheck/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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 koalaman/shellcheck-alpine:v0.7.1

RUN mkdir /projects && \
# Change permissions to let any arbitrary user
for f in "/etc/passwd" "/projects"; do \
echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
chmod -R g+rwX ${f}; \
done

ADD etc/entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
CMD ${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}
1 change: 1 addition & 0 deletions sidecars/shellcheck/PLATFORMS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux/amd64,linux/arm64
31 changes: 31 additions & 0 deletions sidecars/shellcheck/etc/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
#
# Copyright (c) 2018-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
#

set -e
set -x

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

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 "$@"
12 changes: 12 additions & 0 deletions sidecars/sonarlint/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2019 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/eclipse/che-sidecar-java:11-7bd8c8c
RUN apk add --no-cache nodejs
1 change: 1 addition & 0 deletions sidecars/sonarlint/PLATFORMS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux/amd64,linux/ppc64le,linux/s390x,linux/arm64

0 comments on commit 2fcf341

Please sign in to comment.