-
Notifications
You must be signed in to change notification settings - Fork 9
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: wangweijie <[email protected]>
- Loading branch information
Showing
2 changed files
with
60 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,32 @@ | ||
FROM lcr.loongnix.cn/library/buildpack-deps:scm | ||
|
||
# install cgo-related dependencies | ||
RUN set -eux; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends \ | ||
g++ \ | ||
gcc \ | ||
libc6-dev \ | ||
make \ | ||
pkg-config \ | ||
; \ | ||
apt-get autoclean all; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV PATH /usr/local/go/bin:$PATH | ||
|
||
ENV GOLANG_VERSION 1.19.11 | ||
|
||
RUN set -eux; \ | ||
url='http://ftp.loongnix.cn/toolchain/golang/go-1.19/abi2.0/go1.19.11.linux-loong64.tar.gz'; \ | ||
sha256='a2621ea9e658ac4cfc01e7bb3185d210b09a674fed7031f080e01ec06985b4e5'; \ | ||
wget -O go.tgz "$url" --progress=dot:giga; \ | ||
echo "$sha256 *go.tgz" | sha256sum -c -; \ | ||
tar -C /usr/local -xzf go.tgz; \ | ||
rm go.tgz; \ | ||
go version | ||
|
||
ENV GOPATH /go | ||
ENV PATH $GOPATH/bin:$PATH | ||
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" | ||
WORKDIR $GOPATH |
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,28 @@ | ||
# This file is generated by the template. | ||
|
||
REGISTRY ?=lcr.loongnix.cn | ||
ORGANIZATION ?=library | ||
REPOSITORY ?=golang | ||
TAG ?=1.19 | ||
LATEST ?=false | ||
|
||
IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) | ||
LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest | ||
|
||
default: image | ||
|
||
image: | ||
docker build \ | ||
--build-arg http_proxy=$(http_proxy) \ | ||
--build-arg https_proxy=$(https_proxy) \ | ||
-t $(IMAGE) \ | ||
. | ||
|
||
push: | ||
docker push $(IMAGE) | ||
#latest image | ||
@if [ $(LATEST) = "true" ]; \ | ||
then \ | ||
docker tag $(IMAGE) $(LATEST_IMAGE); \ | ||
docker push $(LATEST_IMAGE); \ | ||
fi |