Consider the following Dockerfile:
FROM alpine:edge
EXPOSE \
# web portal
8080 \
# backdoor
8081
Built like so:
docker build .
We observe such output:
Sending build context to Docker daemon 17.1TB
Step 1/2 : FROM alpine:edge
---> 7463224280b0
Step 2/2 : EXPOSE 8080 8081
---> Using cache
---> 7953f8df04d9
[WARNING]: Empty continuation line found in:
EXPOSE 8080 8081
[WARNING]: Empty continuation lines will become errors in a future release.
Successfully built 7953f8df04d9
So, given that it'll soon become illegal to put comments in the middle of a multi-line section: what's the new recommended way to comment multi-line commands?
This is particularly important for RUN
commands, since we are encouraged to reduce image layers by &&
ing commands together.
Not sure exactly when this was introduced, but I'm currently experiencing this in version:
docker --version
Docker version 17.07.0-ce, build 8784753
I'm using Docker's edge release stream, so maybe this will not yet look familiar if you are using Docker stable.