Skip to content

Commit 7f7e298

Browse files
authored
ci: add docker nightly build image task (openGemini#813)
Signed-off-by: Young Xu <xuthus5@gmail.com>
1 parent 07e07cb commit 7f7e298

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: release-nightly
2+
3+
on:
4+
push:
5+
branches: [main, v*, release/v*]
6+
7+
jobs:
8+
nightly-docker:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-go@v5
13+
with:
14+
go-version-file: go.mod
15+
check-latest: true
16+
- name: Login to Docker Hub
17+
uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_TOKEN }}
21+
- uses: docker/setup-qemu-action@v3
22+
- uses: docker/setup-buildx-action@v3
23+
- name: build opengemini docker image
24+
uses: docker/build-push-action@v5
25+
with:
26+
context: .
27+
platforms: linux/amd64,linux/arm64
28+
push: true
29+
file: Dockerfile.nightly
30+
tags: opengeminidb/opengemini-server:nightly

Dockerfile.nightly

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM fedora:latest AS builder
2+
3+
WORKDIR /build
4+
5+
ENV GOPROXY=https://mirrors.huaweicloud.com/repository/goproxy/,https://goproxy.cn,https://proxy.golang.org,direct
6+
ENV CGO_ENABLED=1
7+
8+
RUN dnf install golang gcc gcc-c++ -y --setopt=tsflags=nodocs && dnf clean all
9+
10+
COPY . .
11+
12+
RUN rm -rf go.sum && go mod tidy
13+
14+
RUN go build -ldflags "-s -w" -o ./bin/ts-cli ./app/ts-cli/ &&\
15+
go build -ldflags "-s -w" -o ./bin/ts-server ./app/ts-server/
16+
17+
FROM fedora:latest
18+
19+
WORKDIR /home/opengemini
20+
21+
ENV PATH=$PATH:/home/opengemini/bin
22+
23+
RUN dnf install -y --setopt=tsflags=nodocs net-tools curl bind-utils procps && dnf clean all
24+
25+
COPY --from=builder /build/bin/* /home/opengemini/bin/
26+
COPY --from=builder /build/config/openGemini.singlenode.conf /home/opengemini/config/opengemini.conf
27+
28+
EXPOSE 8086
29+
30+
ENTRYPOINT ["/home/opengemini/bin/ts-server", "-config", "/home/opengemini/config/opengemini.conf"]

0 commit comments

Comments
 (0)