RafikFarhad / push-to-gcr-github-action

An action that build docker image and push to Google Cloud Registry and Google Artifact Registry.
MIT License
68 stars 37 forks source link

tar: invalid tar magic #19

Closed dstoyanoff closed 3 years ago

dstoyanoff commented 3 years ago

Hello @RafikFarhad and thanks for your work on this action.

Today we've started getting the following error: tar: invalid tar magic

Here is a more detailed log:

  /usr/bin/docker build -t c9e036:2329c4a57a1d482193a984c64c130d86 -f "/home/runner/work/_actions/RafikFarhad/push-to-gcr-github-action/v3.0.2/Dockerfile" "/home/runner/work/_actions/RafikFarhad/push-to-gcr-github-action/v3.0.2"
  Sending build context to Docker daemon  28.67kB

  Step 1/9 : FROM docker:19.03.8
   ---> 5cfd4d13e0a8
  Step 2/9 : LABEL maintainer="RafikFarhad <rafikfarhad@gmail.com>"
   ---> Using cache
   ---> 02390b428e5d
  Step 3/9 : RUN apk update &&     apk upgrade &&     apk add --no-cache git curl python bash
   ---> Using cache
   ---> 84da0fa2b2c4
  Step 4/9 : RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz
   ---> Using cache
   ---> 9bb255e7dede
  Step 5/9 : RUN mkdir -p /usr/local/gcloud   && tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz   && /usr/local/gcloud/google-cloud-sdk/install.sh
   ---> Running in 83e556e874f8
  tar: invalid tar magic
  The command '/bin/sh -c mkdir -p /usr/local/gcloud   && tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz   && /usr/local/gcloud/google-cloud-sdk/install.sh' returned a non-zero code: 1
RafikFarhad commented 3 years ago

Hi @dstoyanoff, thanks for using this action.

Using curl without checking checksum is not smooth IMO. So we change that part and replaced the gcloud installation with other repository. So from now on you will not get this error. Please use v4 or later.

And don't forget to add the new step (- uses: google-github-actions/setup-gcloud@master) in your yml which is mandatory from version v4.

Feel free to reopen this if this issue has not been solved for you. Thanks again. 🎉