Skip to content

Parser in docker 1.13 breaks backwards compatibility for comments in middle of RUN statement #29005

@yosifkit

Description

@yosifkit

Description
Previously (Docker 1.6+) one could document long RUN lines with comments interspersed. #24725 broke this.

FROM alpine
RUN echo \
# comment
hi

Steps to reproduce the issue:

  1. build the above Dockerfile on 1.13-rc2

Describe the results you received:
Error response from daemon: Unknown instruction: HI

Describe the results you expected:
Docker build the above Dockerfile on 1.6 through 1.12 (thanks @tianon for testing all of them)
Successfully built xxx

Additional information you deem important (e.g. issue happens only occasionally):
Quick list of some official-images broken by this change:

Output of docker version:
(working version)

Client:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.7.3
 Git commit:   6b644ec
 Built:        
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.7.3
 Git commit:   6b644ec
 Built:        
 OS/Arch:      linux/amd64

Output of docker info:
(working version)

Containers: 6
 Running: 4
 Paused: 0
 Stopped: 2
Images: 5715
Server Version: 1.12.3
Storage Driver: overlay
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null overlay bridge host
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.8.8-gentoo
Operating System: Gentoo/Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 30.87 GiB
Name: isengard
ID: UOCM:3F65:5FZC:6H5L:W3HY:34G4:A5XZ:SUOV:S2D4:XQTO:4KGA:6XSE
Docker Root Dir: /mnt/spare/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions