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

Commit

Permalink
Add Dockerfile to build image for go plugin (#84)
Browse files Browse the repository at this point in the history
* Add Dockerfile to build image for GO Lang plugin

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
  • Loading branch information
tolusha committed Feb 25, 2019
1 parent c514017 commit 3ca14ec
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 5 deletions.
11 changes: 6 additions & 5 deletions build_and_push_docker_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,29 @@ dockerfiles/theia-dev
dockerfiles/theia
dockerfiles/theia-endpoint-runtime
dockerfiles/remote-plugin-runner-java8
dockerfiles/remote-plugin-go-1.10.7
)

IMAGES_LIST=(
eclipse/che-theia-dev
eclipse/che-theia
eclipse/che-theia-endpoint-runtime
eclipse/che-remote-plugin-runner-java8
eclipse/che-remote-plugin-go-1.10.7
)


# BUILD IMAGES
for image_dir in "${DOCKER_FILES_LOCATIONS[@]}"
do
GITHUB_TOKEN_ARG="GITHUB_TOKEN="${GITHUB_TOKEN}
if [ "$image_dir" == "dockerfiles/theia" ]; then
THEIA_IMAGE_TAG="master"
bash $(pwd)/$image_dir/build.sh --build-args:GITHUB_TOKEN=${GITHUB_TOKEN},THEIA_VERSION=master --tag:master --branch:master --git-ref:refs\\/heads\\/master
bash $(pwd)/$image_dir/build.sh --build-args:${GITHUB_TOKEN_ARG},THEIA_VERSION=master --tag:master --branch:master --git-ref:refs\\/heads\\/master
elif [ "$image_dir" == "dockerfiles/theia-dev" ]; then
bash $(pwd)/$image_dir/build.sh --build-arg:GITHUB_TOKEN=${GITHUB_TOKEN} --tag:master
elif [ "$image_dir" == "dockerfiles/theia-endpoint-runtime" ]; then
bash $(pwd)/$image_dir/build.sh --build-arg:GITHUB_TOKEN=${GITHUB_TOKEN}
bash $(pwd)/$image_dir/build.sh --build-arg:${GITHUB_TOKEN_ARG} --tag:master
else
bash $(pwd)/$image_dir/build.sh
bash $(pwd)/$image_dir/build.sh --build-arg:${GITHUB_TOKEN_ARG}
fi
if [ $? -ne 0 ]; then
echo "ERROR:"
Expand Down
74 changes: 74 additions & 0 deletions dockerfiles/remote-plugin-go-1.10.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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 eclipse/che-theia-endpoint-runtime:nightly

RUN set -eux; \
apk add --no-cache --virtual .build-deps \
bash \
gcc \
musl-dev \
openssl \
go \
git \
; \
export \
GOROOT_BOOTSTRAP="$(go env GOROOT)" \
GOOS="$(go env GOOS)" \
GOARCH="$(go env GOARCH)" \
GOHOSTOS="$(go env GOHOSTOS)" \
GOHOSTARCH="$(go env GOHOSTARCH)" \
; \
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
armhf) export GOARM='6' ;; \
x86) export GO386='387' ;; \
esac; \
\
wget -qO- https://dl.google.com/go/go1.10.7.linux-amd64.tar.gz | tar xvz -C /usr/local; \
\
cd /usr/local/go/src; \
./make.bash; \
\
rm -rf \
/usr/local/go/pkg/bootstrap \
/usr/local/go/pkg/obj \
; \
export GOPATH="/go"; \
mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"; \
export PATH="$GOPATH/bin:/usr/local/go/bin:$PATH"; \
go get -u -v github.com/ramya-rao-a/go-outline && \
go get -u -v github.com/acroca/go-symbols && \
go get -u -v github.com/mdempsky/gocode && \
go get -u -v github.com/rogpeppe/godef && \
go get -u -v golang.org/x/tools/cmd/godoc && \
go get -u -v github.com/zmb3/gogetdoc && \
go get -u -v golang.org/x/lint/golint && \
go get -u -v github.com/fatih/gomodifytags && \
go get -u -v golang.org/x/tools/cmd/gorename && \
go get -u -v sourcegraph.com/sqs/goreturns && \
go get -u -v golang.org/x/tools/cmd/goimports && \
go get -u -v github.com/cweill/gotests/... && \
go get -u -v golang.org/x/tools/cmd/guru && \
go get -u -v github.com/josharian/impl && \
go get -u -v github.com/haya14busa/goplay/cmd/goplay && \
go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs && \
go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct && \
go get -u -v github.com/alecthomas/gometalinter && \
go get -u -v github.com/go-delve/delve/cmd/dlv && \
gometalinter --install \
; \
apk del .build-deps \
; \
go version

ENV GOPATH /go
ENV GOROOT /usr/local/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
15 changes: 15 additions & 0 deletions dockerfiles/remote-plugin-go-1.10.7/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-go-1.10.7 "$@"
build

0 comments on commit 3ca14ec

Please sign in to comment.