This is an automated email from the ASF dual-hosted git repository.
zixuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new f7e34f33 improve: install golang by image in the Dockerfile (#1246)
f7e34f33 is described below
commit f7e34f33ad112a43ab445a2882e63c31ba05a577
Author: Zixuan Liu <[email protected]>
AuthorDate: Fri Jul 12 18:53:22 2024 +0800
improve: install golang by image in the Dockerfile (#1246)
---
Dockerfile | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 51e35f0a..eb2caa7f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,18 +18,18 @@
# Explicit version of Pulsar and Golang images should be
# set via the Makefile or CLI
ARG PULSAR_IMAGE=apachepulsar/pulsar:latest
+
+ARG GO_VERSION=1.20
+FROM golang:$GO_VERSION as golang
+
FROM $PULSAR_IMAGE
USER root
-ARG GO_VERSION=1.18
-ARG ARCH=amd64
-RUN curl -L https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz -o
golang.tar.gz && \
- mkdir -p /pulsar/go && tar -C /pulsar -xzf golang.tar.gz
+COPY --from=golang /usr/local/go /pulsar/go
ENV PATH /pulsar/go/bin:$PATH
-RUN apt-get update && apt-get install -y git && apt-get install -y gcc
-
+RUN apt-get update && apt-get install -y git gcc
### Add pulsar config
COPY integration-tests/certs /pulsar/certs