Skip to content

Commit

Permalink
Add golang:1.19
Browse files Browse the repository at this point in the history
Signed-off-by: wangweijie <[email protected]>
  • Loading branch information
wxpppp committed May 7, 2024
1 parent 23a6b97 commit ecaf359
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
32 changes: 32 additions & 0 deletions library/golang/1.19/Dockerfile
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
28 changes: 28 additions & 0 deletions library/golang/1.19/Makefile
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

0 comments on commit ecaf359

Please sign in to comment.