Skip to content

Commit

Permalink
add golang
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinji-IkariG committed Jan 10, 2024
1 parent 99fa737 commit 4cda038
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 12 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* jemalloc
* ldap
* libcurl
* libdwarf
* libevent
* libunwind
* lz4
Expand Down Expand Up @@ -86,7 +87,7 @@ The docker-based build is for building pre-built packages of third parties. For
```shell
# Print all targets
$ make -C $path/build print
centos-7 centos-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2110 ubuntu-2204
centos-7 centos-8 rockylinux-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2204

# Build specific target
$ make -C $path/build centos-7
Expand Down
7 changes: 3 additions & 4 deletions build/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
arch=$(shell uname -m)
tags=centos-7 centos-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2110 ubuntu-2204
tags=centos-7 centos-8 rockylinux-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2204

all: $(tags)

Expand All @@ -21,5 +20,5 @@ ifneq ($(USE_GCC_VERSIONS),)
endif

%:
@echo '******************' Build Nebula Third Party For $*-$(arch) '********************'
@$(docker_cmd) --rm -it vesoft/third-party-build:$*-$(arch) ./run.sh
@echo '******************' Build Nebula Third Party For $* '********************'
@$(docker_cmd) --rm -it vesoft/third-party-build:$* ./run.sh
11 changes: 5 additions & 6 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
arch=$(shell uname -m)
tags=centos-7 centos-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2010
tags=centos-7 centos-8 rockylinux-8 ubuntu-1604 ubuntu-1804 ubuntu-2004 ubuntu-2204

all: $(tags)
.PHONY: all

print:
@echo $(tags)

build-%: $(arch)/%.Dockerfile
build-%: buildx/%.Dockerfile
@echo '******************' Build Nebula Third Party Docker For $*-$(arch) '********************'
@docker build --no-cache -t vesoft/third-party-build:$*-$(arch) -f $(arch)/$*.Dockerfile .
@docker build --no-cache -t vesoft/third-party-build:$* -f buildx/$*.Dockerfile .

push-%: build-%
@echo '******************' Pushing image $*-$(arch) '********************'
@docker push vesoft/third-party-build:$*-$(arch)
@echo '******************' Pushing image $* '********************'
@docker push vesoft/third-party-build:$*

%: push-% ;
13 changes: 13 additions & 0 deletions docker/buildx/centos-7.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM centos:7
SHELL ["/bin/bash", "-c"]
ARG GOLANG_VERSION=1.21.6
RUN yum install -y epel-release && yum update -y \
&& yum install -y make \
git \
Expand Down Expand Up @@ -41,6 +42,18 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0
&& ./cmake-3.20.0-linux-$(uname -m).sh --skip-license --prefix=/usr/local \
&& rm cmake-3.20.0-linux-$(uname -m).sh

# Install golang
RUN ARCH="$(uname -m)"; \
case "${ARCH}" in \
x86_64) GOARCH='amd64';; \
aarch64) GOARCH='arm64';; \
*) echo "Unsupported architecture: ${ARCH}" && exit 1;; \
esac; \
curl -L https://go.dev/dl/go${GOLANG_VERSION}.linux-${GOARCH}.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

# Install ossutil
RUN curl https://gosspublic.alicdn.com/ossutil/install.sh | bash

Expand Down
14 changes: 13 additions & 1 deletion docker/buildx/centos-8.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:8
SHELL ["/bin/bash", "-c"]

ARG GOLANG_VERSION=1.21.6
RUN cd /etc/yum.repos.d/ && \
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
Expand Down Expand Up @@ -42,6 +42,18 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0
&& ./cmake-3.20.0-linux-$(uname -m).sh --skip-license --prefix=/usr/local \
&& rm cmake-3.20.0-linux-$(uname -m).sh

# Install golang
RUN ARCH="$(uname -m)"; \
case "${ARCH}" in \
x86_64) GOARCH='amd64';; \
aarch64) GOARCH='arm64';; \
*) echo "Unsupported architecture: ${ARCH}" && exit 1;; \
esac; \
curl -L https://go.dev/dl/go${GOLANG_VERSION}.linux-${GOARCH}.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

# Install ossutil
RUN curl https://gosspublic.alicdn.com/ossutil/install.sh | bash

Expand Down
13 changes: 13 additions & 0 deletions docker/buildx/rockylinux-8.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM rockylinux:8
SHELL ["/bin/bash", "-c"]
ARG GOLANG_VERSION=1.21.6
RUN yum install -y epel-release yum-utils && yum config-manager --set-enabled powertools && yum update -y \
&& yum install -y make \
git \
Expand Down Expand Up @@ -37,6 +38,18 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0
&& ./cmake-3.20.0-linux-$(uname -m).sh --skip-license --prefix=/usr/local \
&& rm cmake-3.20.0-linux-$(uname -m).sh

# Install golang
RUN ARCH="$(uname -m)"; \
case "${ARCH}" in \
x86_64) GOARCH='amd64';; \
aarch64) GOARCH='arm64';; \
*) echo "Unsupported architecture: ${ARCH}" && exit 1;; \
esac; \
curl -L https://go.dev/dl/go${GOLANG_VERSION}.linux-${GOARCH}.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

# Install ossutil
RUN curl https://gosspublic.alicdn.com/ossutil/install.sh | bash

Expand Down
13 changes: 13 additions & 0 deletions docker/buildx/ubuntu-2004.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM ubuntu:20.04
SHELL ["/bin/bash", "-c"]
ARG GOLANG_VERSION=1.21.6
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update \
Expand Down Expand Up @@ -37,6 +38,18 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0
&& ./cmake-3.20.0-linux-$(uname -m).sh --skip-license --prefix=/usr/local \
&& rm cmake-3.20.0-linux-$(uname -m).sh

# Install golang
RUN ARCH="$(uname -m)"; \
case "${ARCH}" in \
x86_64) GOARCH='amd64';; \
aarch64) GOARCH='arm64';; \
*) echo "Unsupported architecture: ${ARCH}" && exit 1;; \
esac; \
curl -L https://go.dev/dl/go${GOLANG_VERSION}.linux-${GOARCH}.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

# Install ossutil
RUN curl https://gosspublic.alicdn.com/ossutil/install.sh | bash

Expand Down

0 comments on commit 4cda038

Please sign in to comment.