diff --git a/library/golang/1.22-buster/Makefile b/library/golang/1.22-buster/Makefile index 9f93031..9079b0e 100644 --- a/library/golang/1.22-buster/Makefile +++ b/library/golang/1.22-buster/Makefile @@ -7,7 +7,6 @@ TAG ?= 1.22-buster IMAGE = $(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) ALIAS = $(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):1.22 -LATEST = $(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest default: image diff --git a/library/golang/1.23-buster/Dockerfile b/library/golang/1.23-buster/Dockerfile new file mode 100644 index 0000000..85f05ee --- /dev/null +++ b/library/golang/1.23-buster/Dockerfile @@ -0,0 +1,35 @@ +FROM lcr.loongnix.cn/library/debian:sid + +# install cgo-related dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + wget \ + pkg-config \ + ca-certificates \ + ; \ + apt-get autoclean all; \ + rm -rf /var/lib/apt/lists/* + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.23.3 + +RUN set -eux; \ + url='https://go.dev/dl/go1.23.3.linux-loong64.tar.gz'; \ + sha256='1d0161a8946c7d99f717bad23631738408511f9f87e78d852224a023d8882ad8'; \ + 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 + diff --git a/library/golang/1.23-buster/Makefile b/library/golang/1.23-buster/Makefile new file mode 100644 index 0000000..6437abd --- /dev/null +++ b/library/golang/1.23-buster/Makefile @@ -0,0 +1,30 @@ +# This file is generated by the template. + +REGISTRY ?= lcr.loongnix.cn +ORGANIZATION ?= library +REPOSITORY ?= golang +TAG ?= 1.23-buster + +IMAGE = $(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) +ALIAS = $(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):1.23 +LATEST = $(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest + +default: image + +image: + docker build \ + -t $(IMAGE) \ + . + +push: alias + docker push $(IMAGE) + docker push $(ALIAS) + +ifneq ($(LATEST),) + docker tag $(IMAGE) $(LATEST) + docker push $(LATEST) +endif + +alias: + docker tag $(IMAGE) $(ALIAS) +