Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to fix "ERROR: No build stage in current context"
Problem:
$ docker-compose up --build
Building xxx
ERROR: No build stage in current context
Analysis:
Dockerfile
# you do something BEFORE the 'FROM' statement
COPY --chown=root:root /php /var/www/html/
FROM php:5.6.39-apache
Solution:
# do something AFTER the 'FROM' statement
FROM php:5.6.39-apache
COPY --chown=root:root /php /var/www/html/
@d0zingcat

This comment has been minimized.

Copy link

@d0zingcat d0zingcat commented Apr 1, 2020

just to add one notice, the maintainer tag should not be placed above FROM clause, as the first statement must be FROM clause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment