Skip to content

Commit

Permalink
[Improve]Change base image to apachepulsar/pulsar (apache#1195)
Browse files Browse the repository at this point in the history
### Motivation
There are related discussion records [here](apache#1037). It is recommended to switch the base image to `apachepulsar/pulsar`.


### Modifications

Change base image to `apachepulsar/pulsar`.
  • Loading branch information
crossoverJie authored Mar 8, 2024
1 parent 143fa23 commit 4f21379
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.18', '1.19', '1.20', '1.21']
go-version: ['1.18', '1.19', '1.20', '1.21.0']
steps:
- uses: actions/checkout@v3
- name: clean docker cache
Expand Down
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
# Explicit version of Pulsar and Golang images should be
# set via the Makefile or CLI
ARG PULSAR_IMAGE=apachepulsar/pulsar:latest
ARG GOLANG_IMAGE=golang:latest
FROM $PULSAR_IMAGE
USER root
ARG GO_VERSION=1.18

FROM $PULSAR_IMAGE as pulsar
FROM $GOLANG_IMAGE
RUN curl -L https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz -o golang.tar.gz && \
mkdir -p /pulsar/go && tar -C /pulsar -xzf golang.tar.gz

RUN apt-get update && apt-get install -y openjdk-17-jre ca-certificates
ENV PATH /pulsar/go/bin:$PATH

RUN apt-get update && apt-get install -y git && apt-get install -y gcc

COPY --from=pulsar /pulsar /pulsar

### Add pulsar config
COPY integration-tests/certs /pulsar/certs
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ IMAGE_NAME = pulsar-client-go-test:latest
PULSAR_VERSION ?= 3.2.0
PULSAR_IMAGE = apachepulsar/pulsar:$(PULSAR_VERSION)
GO_VERSION ?= 1.18
GOLANG_IMAGE = golang:$(GO_VERSION)

# Golang standard bin directory.
GOPATH ?= $(shell go env GOPATH)
Expand All @@ -39,7 +38,7 @@ bin/golangci-lint:
GOBIN=$(shell pwd)/bin go install github.com/golangci/golangci-lint/cmd/[email protected]

container:
docker build -t ${IMAGE_NAME} --build-arg GOLANG_IMAGE="${GOLANG_IMAGE}" \
docker build -t ${IMAGE_NAME} --build-arg GO_VERSION="${GO_VERSION}" \
--build-arg PULSAR_IMAGE="${PULSAR_IMAGE}" .

test: container
Expand Down
3 changes: 2 additions & 1 deletion scripts/run-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

set -e -x

export GOPATH=/
export GOPATH=/pulsar/go
export GOCACHE=/tmp/go-cache

# Install dependencies
go mod download
Expand Down

0 comments on commit 4f21379

Please sign in to comment.