-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: shruti2522 <[email protected]>
- Loading branch information
1 parent
7e8007a
commit 3d6122b
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright 2021 The KCL Authors. All rights reserved. | ||
|
||
FROM alpine:latest | ||
|
||
# set timezone | ||
RUN apk add --no-cache tzdata \ | ||
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | ||
&& echo 'Asia/Shanghai' >/etc/timezone | ||
|
||
# update repositories and install required packages | ||
RUN apk add --no-cache \ | ||
make \ | ||
wget \ | ||
git \ | ||
ca-certificates \ | ||
clang \ | ||
llvm \ | ||
libffi-dev \ | ||
go \ | ||
python3 \ | ||
python3-dev \ | ||
py3-pip | ||
|
||
# set environment variables | ||
ENV GOPATH=/go \ | ||
GOLANG_VERSION=1.20.5 \ | ||
PATH="/root/.cargo/bin:${PATH}" \ | ||
CARGO_NET_GIT_FETCH_WITH_CLI=true | ||
|
||
# install rust and cargo | ||
RUN wget -qO- https://sh.rustup.rs | sh -s -- -y \ | ||
&& echo 'source $HOME/.cargo/env' >> $HOME/.ashrc \ | ||
&& . $HOME/.cargo/env \ | ||
&& cargo version \ | ||
&& rustc --version | ||
|
||
# install go tools | ||
RUN go install golang.org/x/lint/golint@latest \ | ||
&& go install golang.org/x/tools/cmd/goimports@latest \ | ||
&& go install github.com/t-yuki/gocover-cobertura@latest \ | ||
&& go install github.com/jstemmer/go-junit-report@latest | ||
|
||
RUN rm -rf /root/.cache/go-build \ | ||
&& rm -rf /go/pkg/mod \ | ||
&& rm -rf /go/pkg/sumdb \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
WORKDIR /root | ||
|
||
CMD ["ash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2021 The KCL Authors. All rights reserved. | ||
|
||
PWD:=$(shell pwd) | ||
|
||
BUILDER_IMAGE:=kcllang/kcl-builder-alpine | ||
|
||
# export DOCKER_DEFAULT_PLATFORM=linux/amd64 | ||
# or | ||
# --platform linux/amd64 | ||
|
||
RUN_IN_DOCKER:=docker run -it --rm --platform linux/amd64 | ||
RUN_IN_DOCKER+=-v ~/.ssh:/root/.ssh | ||
RUN_IN_DOCKER+=-v ~/.gitconfig:/root/.gitconfig | ||
RUN_IN_DOCKER+=-v ~/go/pkg/mod:/go/pkg/mod | ||
|
||
kcl-builder: | ||
docker build --platform linux/amd64 -t ${BUILDER_IMAGE} . | ||
@echo "ok" | ||
|
||
publish-builder: | ||
# docker login --username= | ||
|
||
# make kcl-builder | ||
docker push ${BUILDER_IMAGE} | ||
@echo "push ${BUILDER_IMAGE} ok" | ||
|
||
sh-in-builder: | ||
${RUN_IN_DOCKER} -v ${PWD}/../../..:/root/kclvm -w /root ${BUILDER_IMAGE} sh | ||
|
||
clean: |