Andrei
Andrei

Reputation: 367

windows docker unknown instruction VERSION:

I'm trying to run a "docker build" command for a specified file but I always get an "unknown instruction" message no matter what instruction is inside yml file (the only one which worked for me was FROM instruction).

The yam file starts with the following

version: '3'
services:

After running I get the following:

Error response from daemon: Dockerfile parse error line 1: unknown instruction: VERSION:

Operating System is: Windows 7 docker version 18.01.0

Tried to save the file with different encodings, no one worked for me. Does anyone know a solution?

Upvotes: 0

Views: 6263

Answers (2)

James Dewes
James Dewes

Reputation: 387

If your using a yml file try docker-compose rather than docker build. Otherwise try prefixing the version information with LABEL e.g. LABEL version="1.0"

Upvotes: 0

BMitch
BMitch

Reputation: 263469

VERSION is not a valid line in a Dockerfile. You appear to be confusing a Dockerfile with a docker-compose.yml. These are two different files, with two different syntaxes and purposes.

Upvotes: 2

Related Questions