From c8a0edf3bed42fe892a3cf2451ac431b240cae29 Mon Sep 17 00:00:00 2001 From: SungWook Kim Date: Thu, 25 Mar 2021 18:09:58 +0900 Subject: [PATCH] [#noissue] add version change in flink --- docker-compose.yml | 8 +++++++- pinpoint-flink/Dockerfile | 13 +++++++++---- pinpoint-flink/docker-bin/docker-entrypoint.sh | 6 +++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4671c18..29f23d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -252,6 +252,9 @@ services: build: context: pinpoint-flink dockerfile: Dockerfile + args: + - PINPOINT_VERSION=${PINPOINT_VERSION} + container_name: "${PINPOINT_FLINK_NAME}-jobmanager" image: "pinpointdocker/pinpoint-flink:${PINPOINT_VERSION}" expose: @@ -271,8 +274,11 @@ services: build: context: pinpoint-flink dockerfile: Dockerfile + args: + - PINPOINT_VERSION=${PINPOINT_VERSION} + container_name: "${PINPOINT_FLINK_NAME}-taskmanager" - image: ${PINPOINT_FLINK_NAME}-flink:dev + image: "pinpointdocker/pinpoint-flink:${PINPOINT_VERSION}" expose: - "6121" - "6122" diff --git a/pinpoint-flink/Dockerfile b/pinpoint-flink/Dockerfile index 0aa4d02..23f4b40 100644 --- a/pinpoint-flink/Dockerfile +++ b/pinpoint-flink/Dockerfile @@ -1,10 +1,15 @@ FROM flink:1.7 -ARG PINPOINT_VERSION=2.2.0 +ARG PINPOINT_VERSION=${PINPOINT_VERSION:-2.2.2} +ARG INSTALL_URL=https://github.com/pinpoint-apm/pinpoint/releases/download/v${PINPOINT_VERSION}/pinpoint-flink-job-${PINPOINT_VERSION}.jar + RUN apt-get update \ && apt-get install --no-install-recommends -y zip \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* -ADD https://github.com/pinpoint-apm/pinpoint/releases/download/v${PINPOINT_VERSION}/pinpoint-flink-job-${PINPOINT_VERSION}.jar /build/ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /build \ + && curl -SL ${INSTALL_URL} -o /build/pinpoint-flink-job.jar + COPY build/ /build/ COPY docker-bin/ /docker-bin/ -ENTRYPOINT ["/docker-bin/docker-entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/docker-bin/docker-entrypoint.sh"] + diff --git a/pinpoint-flink/docker-bin/docker-entrypoint.sh b/pinpoint-flink/docker-bin/docker-entrypoint.sh index dc8c5d7..e0c36be 100755 --- a/pinpoint-flink/docker-bin/docker-entrypoint.sh +++ b/pinpoint-flink/docker-bin/docker-entrypoint.sh @@ -3,12 +3,12 @@ # In flink version < 1.11 we can't use "job cluster" because it's not yet available if [ "$1" = "standalone-job" ]; then cd /build - zip -d pinpoint-flink-job-*.jar "profiles/release/*.properties" + zip -d pinpoint-flink-job.jar "profiles/release/*.properties" sed -i -e "s/#PINPOINT_ZOOKEEPER_ADDRESS#/${PINPOINT_ZOOKEEPER_ADDRESS}/g" profiles/release/* - zip -r pinpoint-flink-job-*.jar profiles/ + zip -r pinpoint-flink-job.jar profiles/ cd - - mv /build/pinpoint-flink-job-*.jar pinpoint-flink-job.jar + mv /build/pinpoint-flink-job.jar pinpoint-flink-job.jar shift