From 7bcc44e44ea6d720ca4f5cbe730cbf528157d568 Mon Sep 17 00:00:00 2001 From: Dimitris Sotirakis Date: Tue, 30 Nov 2021 17:29:37 +0200 Subject: [PATCH] [v8.2.x] CI: Update Dockerfile (#42529) * Update Dockerfile * Run apt-get update before download service clients --- .drone.yml | 18 +++++++++++++++++- scripts/build/ci-build/Dockerfile | 6 ++++++ scripts/drone/steps/lib.star | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index f8756c84f5b..c61d25eac38 100644 --- a/.drone.yml +++ b/.drone.yml @@ -191,6 +191,7 @@ steps: - name: postgres-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq postgresql-client - dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -207,6 +208,7 @@ steps: - name: mysql-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq default-mysql-client - dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -490,6 +492,7 @@ steps: - name: postgres-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq postgresql-client - dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -506,6 +509,7 @@ steps: - name: mysql-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq default-mysql-client - dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -906,6 +910,7 @@ steps: - name: postgres-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq postgresql-client - dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -922,6 +927,7 @@ steps: - name: mysql-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq default-mysql-client - dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -1293,6 +1299,7 @@ steps: - name: postgres-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq postgresql-client - dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -1309,6 +1316,7 @@ steps: - name: mysql-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq default-mysql-client - dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -1830,6 +1838,7 @@ steps: - name: postgres-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq postgresql-client - dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -1846,6 +1855,7 @@ steps: - name: mysql-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq default-mysql-client - dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -2206,6 +2216,7 @@ steps: - name: postgres-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq postgresql-client - dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -2222,6 +2233,7 @@ steps: - name: mysql-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq default-mysql-client - dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -2739,6 +2751,7 @@ steps: - name: postgres-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq postgresql-client - dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -2755,6 +2768,7 @@ steps: - name: mysql-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq default-mysql-client - dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -3093,6 +3107,7 @@ steps: - name: postgres-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq postgresql-client - dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -3109,6 +3124,7 @@ steps: - name: mysql-integration-tests image: grafana/build-container:1.4.3 commands: + - apt-get update - apt-get install -yq default-mysql-client - dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -3430,6 +3446,6 @@ get: --- kind: signature -hmac: a63230a1a54a9c53c72a38bc69c6495f5b1199b5b21324b6cb00d1fd416628a2 +hmac: c27ac8c63440e97000f65b80e9fa1a19bb65a09114203ad257b41371481ff626 ... diff --git a/scripts/build/ci-build/Dockerfile b/scripts/build/ci-build/Dockerfile index 8e3e3f600a0..af251f3e111 100644 --- a/scripts/build/ci-build/Dockerfile +++ b/scripts/build/ci-build/Dockerfile @@ -96,6 +96,11 @@ RUN curl -fLO https://github.com/cuelang/cue/releases/download/v${CUE_VERSION}/c RUN echo $CUE_CHKSUM cue_${CUE_VERSION}_Linux_x86_64.tar.gz | sha256sum --check --strict --status RUN tar xf cue_${CUE_VERSION}_Linux_x86_64.tar.gz -C /tmp cue +ARG DOCKERIZE_VERSION=0.6.1 +RUN curl -fLO https://github.com/jwilder/dockerize/releases/download/v${DOCKERIZE_VERSION}/dockerize-linux-amd64-v${DOCKERIZE_VERSION}.tar.gz +RUN tar -xzvf dockerize-linux-amd64-v${DOCKERIZE_VERSION}.tar.gz -C /tmp/ +RUN rm dockerize-linux-amd64-v${DOCKERIZE_VERSION}.tar.gz + # Base image to crossbuild grafana. # Use old Debian (this has support into 2022) in order to ensure binary compatibility with older glibc's. FROM debian:stretch-20210208 @@ -113,6 +118,7 @@ COPY --from=toolchain /tmp/x86_64-centos6-linux-gnu.tar.xz /tmp/osxcross.tar.xz COPY --from=toolchain /tmp/golangci-lint /usr/local/bin/ COPY --from=toolchain /tmp/shellcheck /usr/local/bin/ COPY --from=toolchain /tmp/cue /usr/local/bin/ +COPY --from=toolchain /tmp/dockerize /usr/local/bin/ RUN apt-get update && \ apt-get install -yq \ diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index f0d5b351316..8903cf3833f 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -686,6 +686,7 @@ def postgres_integration_tests_step(): 'POSTGRES_HOST': 'postgres', }, 'commands': [ + 'apt-get update', 'apt-get install -yq postgresql-client', 'dockerize -wait tcp://postgres:5432 -timeout 120s', 'psql -p 5432 -h postgres -U grafanatest -d grafanatest -f ' + @@ -709,6 +710,7 @@ def mysql_integration_tests_step(): 'MYSQL_HOST': 'mysql', }, 'commands': [ + 'apt-get update', 'apt-get install -yq default-mysql-client', 'dockerize -wait tcp://mysql:3306 -timeout 120s', 'cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass',