0

I'm learning how to used Docker and gcp using this quickstart, but have an error I can't fix. There are two files in the folder, Dockerfile.txt and quickstart.sh.

The Dockerfile has been created using Notepad++ and saved as a Dockerfile.txt file. When I run the command

gcloud builds submit --tag gcr.io/[PROJECT_ID]/quickstart-image .

I get an error

gzip: stdin: invalid compressed data--crc error
gzip: stdin: invalid compressed data--length error
tar: Child returned status 1
tar: Error is not recoverable: exiting now
ERROR
ERROR: fetching gcs source: unpacking tarball: exit status 2

I think this is caused by the Dockerfile format, should it be a bash file? I've recreated the file several times to make sure its not corrupted.

These are the files in the directory:

hugh@Hugh_Laptop:/mnt/d/temp$ ls -l
total 0
-rwxrwxrwx 1 hugh hugh 55 Nov 21 15:05 Dockerfile.bash
-rwxrwxrwx 1 hugh hugh 51 Nov 21 13:38 quickstart.sh
Maxim
  • 4,075
  • 1
  • 14
  • 23
Zeus
  • 1,496
  • 2
  • 24
  • 53
  • What files are in the directory `.` (current directory)? Execute `ls -l' and add the output to your question. – John Hanley Nov 21 '18 at 04:44
  • What program did you create your text files with? – John Hanley Nov 21 '18 at 04:47
  • both files created with Notepad++ – Zeus Nov 21 '18 at 04:48
  • What selection in Notepad++ for "Save as type" when you saved the files? – John Hanley Nov 21 '18 at 04:51
  • I saved it as a normal .txt file – Zeus Nov 21 '18 at 05:04
  • saving as Dockerfile.bash results in a different error message ``BUILD Already have image (with digest): gcr.io/cloud-builders/docker unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /workspace/Dockerfile: no such file or directory ERROR ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1`` – Zeus Nov 21 '18 at 05:08
  • What files are in the directory . (current directory)? Execute `ls -l' and add the output to your question. – John Hanley Nov 21 '18 at 05:10
  • The name of the file must be Dockerfile, nothing else. – John Hanley Nov 21 '18 at 05:11
  • If you are on Windows, use `dir` and post that output (all of it). – John Hanley Nov 21 '18 at 05:12
  • see edited question with directory output using ubuntu – Zeus Nov 21 '18 at 05:15
  • What happens when you run this command: `docker build -t example .` Don't forget the dot at the end. – John Hanley Nov 21 '18 at 05:19
  • Are you low on disk space in any of the mounted partitions? – John Hanley Nov 21 '18 at 05:20
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/184003/discussion-between-zeus-and-john-hanley). – Zeus Nov 21 '18 at 05:22
  • no plenty of disk space, running ``build -t example`` results in ``Command 'docker' not found, but can be installed with sudo apt install docker.io`` but running cmd results in ``unable to locate package docker.io`` – Zeus Nov 21 '18 at 05:26
  • A correctly setup development system is the first and most important step. Start over, get docker installed and running correctly, your tools, etc. I am stopping for the night. Make sure you post the solution as I am very curious. – John Hanley Nov 21 '18 at 05:33

2 Answers2

1

You most probably don't have python2 installed or set as default for /bin/python.

Install python2 and try again.

cristi
  • 2,019
  • 1
  • 22
  • 31
0

My guess is that the extension of the Dockerfile is the cause of the issue.

I suggest to create a new Dockerfile without the any extension.

Guillermo Cacheda
  • 2,162
  • 14
  • 23