Skip to content

Commit

Permalink
library/golang: Add 1.23-buster support.
Browse files Browse the repository at this point in the history
  • Loading branch information
abner-chenc committed Dec 7, 2024
1 parent 5ade166 commit 9940516
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
1 change: 0 additions & 1 deletion library/golang/1.22-buster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
34 changes: 34 additions & 0 deletions library/golang/1.23-buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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 \
; \
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

30 changes: 30 additions & 0 deletions library/golang/1.23-buster/Makefile
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 9940516

Please sign in to comment.