Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Add docker file to build clang image (#401)
Browse files Browse the repository at this point in the history
* Add docker file to build clang image

Signed-off-by: Anatoliy Bazko <[email protected]>
  • Loading branch information
tolusha authored Aug 15, 2019
1 parent b94aadc commit 984a90d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docker_image_build.include
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dockerfiles/remote-plugin-java8
dockerfiles/remote-plugin-java11
dockerfiles/remote-plugin-php7
dockerfiles/remote-plugin-go-1.10.7
dockerfiles/remote-plugin-clang-8
dockerfiles/remote-plugin-python-3.7.3
dockerfiles/remote-plugin-dotnet-2.2.105
dockerfiles/remote-plugin-kubernetes-tooling-0.1.17
Expand All @@ -49,6 +50,7 @@ eclipse/che-remote-plugin-runner-java8
eclipse/che-remote-plugin-runner-java11
eclipse/che-remote-plugin-php7
eclipse/che-remote-plugin-go-1.10.7
eclipse/che-remote-plugin-clang-8
eclipse/che-remote-plugin-python-3.7.3
eclipse/che-remote-plugin-dotnet-2.2.105
eclipse/che-remote-plugin-kubernetes-tooling-0.1.17
Expand All @@ -64,7 +66,7 @@ buildImages() {
do
GITHUB_TOKEN_ARG="GITHUB_TOKEN="${GITHUB_TOKEN}
if [ "$image_dir" == "dockerfiles/theia" ]; then
bash $(pwd)/$image_dir/build.sh --build-args:${GITHUB_TOKEN_ARG},THEIA_VERSION=${THEIA_VERSION} --tag:${IMAGE_TAG} --branch:${THEIA_BRANCH} --git-ref:${THEIA_GIT_REFS}
bash $(pwd)/$image_dir/build.sh --build-args:${GITHUB_TOKEN_ARG},THEIA_VERSION=${THEIA_VERSION} --tag:${IMAGE_TAG} --branch:${THEIA_BRANCH} --git-ref:${THEIA_GIT_REFS}
elif [ "$image_dir" == "dockerfiles/theia-dev" ]; then
bash $(pwd)/$image_dir/build.sh --build-arg:${GITHUB_TOKEN_ARG} --tag:${IMAGE_TAG}
else
Expand Down
38 changes: 38 additions & 0 deletions dockerfiles/remote-plugin-clang-8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-theia-endpoint-runtime:${BUILD_TAG} as endpoint

FROM debian:10-slim

ENV HOME=/home/theia

RUN apt-get update && \
apt-get install wget gnupg -y && \
echo 'deb http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main' >> /etc/apt/sources.list && \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
wget -O - https://deb.nodesource.com/setup_10.x | bash - && \
apt-get update && \
apt-get install nodejs clang-8 clang-tools-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

COPY --from=endpoint /home/theia /home/theia
COPY --from=endpoint /projects /projects
COPY --from=endpoint /etc/passwd /etc/passwd
COPY --from=endpoint /etc/group /etc/group
COPY --from=endpoint /entrypoint.sh /entrypoint.sh

RUN chmod -R 777 ${HOME}

ENTRYPOINT ["bash", "/entrypoint.sh"]
15 changes: 15 additions & 0 deletions dockerfiles/remote-plugin-clang-8/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
#
# 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
#

base_dir=$(cd "$(dirname "$0")"; pwd)
. "${base_dir}"/../build.include

init --name:remote-plugin-clang-8 "$@"
build

0 comments on commit 984a90d

Please sign in to comment.