Skip to content

Commit

Permalink
Merge pull request #98 from acend/dst/add_browser
Browse files Browse the repository at this point in the history
dst/add browser
  • Loading branch information
sybnex authored Oct 19, 2022
2 parents e5d5f3f + 8ea6f18 commit 814c70b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 30 deletions.
49 changes: 24 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,24 @@ ARG MINIKUBE_VERSION=v1.27.1
# renovate: datasource=github-tags depName=aquasecurity/trivy
ARG TRIVY_VERSION=0.32.1

RUN addgroup theia && \
adduser -G theia -s /bin/sh -D theia && \
chmod g+rw /home && \
mkdir -p /home/project && \
chown -R theia:theia /home/theia && \
chown -R theia:theia /home/project

RUN apk --no-cache update && \
apk --no-cache -U upgrade -a && \
apk add --no-cache git openssh-client-default bash libsecret \
apk add --no-cache git openssh-client-default bash libsecret chromium \
zsh zsh-autosuggestions podman buildah nano \
coreutils grep curl gettext vim tree git p7zip gcompat \
docker-cli mysql-client lynx bind-tools figlet jq libffi \
bash-completion docker-bash-completion git-bash-completion \
py3-pip py3-yaml py3-pynacl py3-bcrypt py3-cryptography \
py3-wheel py3-cffi py3-openssl py3-psutil>=5.9

RUN pip3 install azure-cli==${AZURECLI_VERSION} --no-cache-dir && \
py3-wheel py3-cffi py3-openssl py3-psutil>=5.9 && \
# azure
pip3 install azure-cli==${AZURECLI_VERSION} --no-cache-dir && \
# azure cli cleanup
bash -c "rm -rf /usr/lib/python3.10/site-packages/azure/mgmt/containerservice/v201*" && \
bash -c "rm -rf /usr/lib/python3.10/site-packages/azure/mgmt/compute/v201*" && \
Expand All @@ -61,9 +68,9 @@ RUN pip3 install azure-cli==${AZURECLI_VERSION} --no-cache-dir && \
bash -c "rm -rf /usr/lib/python3.10/site-packages/azure/mgmt/sql" && \
bash -c "rm -rf /usr/lib/python3.10/site-packages/azure/mgmt/web" && \
bash -c "rm -rf /usr/lib/python3.10/site-packages/azure/mgmt/databoxedge" && \
bash -c "rm -rf /usr/lib/python3.10/site-packages/azure/mgmt/synapse"

RUN curl -#L -o kubectl "https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \
bash -c "rm -rf /usr/lib/python3.10/site-packages/azure/mgmt/synapse" && \
# kubectl
curl -#L -o kubectl "https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \
install -t /usr/local/bin kubectl && rm kubectl && \
# krew
curl -fsSLO https://github.com/kubernetes-sigs/krew/releases/latest/download/krew-linux_amd64.tar.gz && \
Expand Down Expand Up @@ -97,33 +104,25 @@ RUN curl -#L -o kubectl "https://storage.googleapis.com/kubernetes-release/relea
install -t /usr/local/bin minikube && rm minikube && \
# Trivy
curl -#L "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" | tar -xvz trivy && \
install -t /usr/local/bin trivy && rm trivy

RUN addgroup theia && \
adduser -G theia -s /bin/sh -D theia && \
chmod g+rw /home && \
mkdir -p /home/project && \
chown -R theia:theia /home/theia && \
chown -R theia:theia /home/project

RUN git config --global advice.detachedHead false && \
install -t /usr/local/bin trivy && rm trivy && \
# terraform
git config --global advice.detachedHead false && \
# tfenv & terraform
cd /opt/ && git clone --depth 1 --branch ${TFENV_VERSION} https://github.com/tfutils/tfenv.git 2>/dev/null && \
ln -s /opt/tfenv/bin/* /usr/local/bin && \
tfenv install ${TERRAFORM_VERSION} && \
tfenv use ${TERRAFORM_VERSION} && \
export TFENV_TERRAFORM_VERSION=$(echo $TERRAFORM_VERSION | sed -e "s/v//") && \
tfenv install && \
tfenv use && \
sed -i 's/#mount_program/mount_program/' /etc/containers/storage.conf

ENV HOME /home/theia
WORKDIR /home/theia

COPY --from=0 --chown=theia:theia /home/theia /home/theia
EXPOSE 3000

ENV SHELL=/bin/bash \
THEIA_DEFAULT_PLUGINS=local-dir:/home/theia/plugins
ENV USE_LOCAL_GIT true
THEIA_DEFAULT_PLUGINS=local-dir:/home/theia/plugins \
THEIA_WEBVIEW_EXTERNAL_ENDPOINT='{{uuid}}.{{hostname}}'\
USE_LOCAL_GIT=true

USER theia
EXPOSE 3000
COPY bashrc /home/theia/.bashrc
ENTRYPOINT [ "node", "/home/theia/src-gen/backend/main.js", "/home/project", "--hostname=0.0.0.0" ]
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ build() {
echo -e "\nBuild:\n"
set -e
if [ -n "$(which docker)" ]; then
docker build -t $ORG/$APP .
DOCKER_BUILDKIT=1 docker build -t $ORG/$APP .
test_image
docker push $ORG/$APP
elif [ -n "$(which buildah)" ]; then
Expand Down
4 changes: 2 additions & 2 deletions deploy/charts/webshell/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: webshell
description: A Helm chart to deploy a webshell environment
type: application
version: 0.2.16
appVersion: "0.2.16"
version: 0.2.17
appVersion: "0.2.17"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
"golang": "https://open-vsx.org/api/vscode/go/1.62.3/file/vscode.go-1.62.3.vsix",
"python": "https://open-vsx.org/api/vscode/python/1.62.3/file/vscode.python-1.62.3.vsix",
"docker": "https://open-vsx.org/api/vscode/docker/1.62.3/file/vscode.docker-1.62.3.vsix",
"browser": "https://open-vsx.org/api/antfu/browse-lite/0.3.0/file/antfu.browse-lite-0.3.0.vsix",
"dockerfile": "https://open-vsx.org/api/jeff-hykin/better-dockerfile-syntax/1.0.2/file/jeff-hykin.better-dockerfile-syntax-1.0.2.vsix",
"markdown": "https://open-vsx.org/api/vscode/markdown/1.62.3/file/vscode.markdown-1.62.3.vsix",
"terraform": "https://open-vsx.org/api/4ops/terraform/0.2.1/file/4ops.terraform-0.2.1.vsix",
"yaml.lint": "https://open-vsx.org/api/phil9909/ytt-lint/0.3.1/file/phil9909.ytt-lint-0.3.1.vsix",
"kubernetes": "https://github.com/vscode-kubernetes-tools/vscode-kubernetes-tools/releases/download/1.3.8/vscode-kubernetes-tools-1.3.8.vsix"
"yaml.lint": "https://open-vsx.org/api/phil9909/ytt-lint/0.3.1/file/phil9909.ytt-lint-0.3.1.vsix"
},
"theiaPluginsExcludeIds": [
"ms-vscode.js-debug-companion",
Expand Down

0 comments on commit 814c70b

Please sign in to comment.