1

I'm trying to build a dockerfile using google cloud platform\cloud build and the quickstart guide. I enter the steps in google shell but get the error

-bash: FROM: command not found

on the command FROM alpine (Preparing source files, step 2).

I must be making a basic mistake, I assume cloud build can create a dockerfile, and is there a command that needs to be entered before the FROM alpine command?

Zeus
  • 1,496
  • 2
  • 24
  • 53

1 Answers1

1

You need to create a file named Dockerfile with an editor such as vi. Then enter the commands into the file and save.

You tried to enter the Dockerfile statements into your shell.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
  • thanks John. I've created the file but when I enter the command ``chmod +x quickstart.sh`` from a windows terminal in the folder where the file is saved, I get another error ``"chmod" is not recognized as an internal or external command,operable program or batch file.`` – Zeus Nov 21 '18 at 01:30
  • How did you get Powershell into your gcloud shell? – John Hanley Nov 21 '18 at 02:05
  • I didn't open Powershell in the gcloud shell, just opened it on its own. I've now created the files using Notepad++, installed linux/bash on windows ``(https://www.youtube.com/watch?v=xzgwDbe7foQ)`` and continuing to work through the quickstart guide – Zeus Nov 21 '18 at 03:04
  • John when executing this command ``gcloud builds submit --tag gcr.io/[PROJECT_ID]/quickstart-image .`` I get an error ``gzip: stdin: invalid compressed data--format violated``. I created the Dockerfile and quickstart.sh files using Notepad++, is this the correct method? – Zeus Nov 21 '18 at 03:35
  • @Zeus - Open a new question and I will help you. Long comment threads are frowned upon at StackOverflow. Let me know the question URL here. – John Hanley Nov 21 '18 at 04:10
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/184002/discussion-between-zeus-and-john-hanley). – Zeus Nov 21 '18 at 04:39
  • https://stackoverflow.com/questions/53405349/docker-file-error-gzip-stdin-invalid-compressed-data-crc-error – Zeus Nov 21 '18 at 04:39