Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change e2e-test dockerfile #1863

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions Dockerfile.e2e-test
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,26 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM debian:9
# Check End of Life Date wiki.debian.org/DebianReleases
# and replace with a new one if needed
FROM debian:11

ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
code-elinka marked this conversation as resolved.
Show resolved Hide resolved
ARG CLOUD_SDK_VERSION="416.0.0-0"
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION

COPY cmd/e2e-test/run.sh /run.sh
RUN apt-get update && apt-get install -y curl python
RUN curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-206.0.0-linux-x86_64.tar.gz | tar -zxf -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

common pattern for multiarch image is to use the env variable to build the url, see this example https://github.com/kubernetes-sigs/kind/blob/7d26b50a129faf1a7024ce1337d516aada1db118/images/base/Dockerfile#L32

curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-206.0.0-linux-$TARGET_ARCH.tar.gz

don't know if it is needed, but if the new URL download binaries without the right architecture it will fail, or is the new approach installer handling this internally?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! Thank you. I added two vars:

  • ARCH
  • CLOUD_SDK_VERSION

And removed lines with installations, kept only downloading the directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# Download Google Cloud GPG and install google-cloud-cli
# See recommended instructions:
# cloud.google.com/sdk/docs/install#installation_instructions
RUN apt-get update && \
apt-get install -y curl python apt-transport-https ca-certificates gnupg && \
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] \
http://packages.cloud.google.com/apt cloud-sdk main" | \
tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
apt-get update -y && apt-get install google-cloud-cli=$CLOUD_SDK_VERSION -y

ENTRYPOINT ["/run.sh"]