docker / docker/cli

.dockerignore can't deal with filenames with "+" in them

Open
#2,461 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/builder
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

Neither ignoring nor unignoring files with "+" in them seems to be at all possible.

Steps to reproduce the issue:

  1. Create a .dockerignore:
/o++o
  1. Create a Dockerfile:
FROM alpine:3.11.5
ADD . /src
RUN ls /src
  1. Run touch o++o.
  2. Run docker build .

Second scenario: do everything the same as above, but use o+o instead of o++o.

Describe the results you received:

First scenario:

error checking context: 'syntax error in pattern'.

Second scenario:

[...]
 ---> Running in a9dfccb86d27
Dockerfile
o+o
[...]

Describe the results you expected:

Both scenarios:

[...]
 ---> Running in a9dfccb86d27
Dockerfile
[...]

Output of docker version:


Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b7f0
 Built:             Wed Mar 11 01:25:56 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b7f0
  Built:            Wed Mar 11 01:24:28 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker info:

Client:
 Debug Mode: false

Server:
 Containers: 2
  Running: 0
  Paused: 0
  Stopped: 2
 Images: 35
 Server Version: 19.03.8
 Storage Driver: overlay2
  Backing Filesystem: <unknown>
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.9.87-xxxx-std-ipv6-64
 Operating System: Debian GNU/Linux 10 (buster)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.57GiB
 Name: ra
 ID: 2VMD:IG4A:U2Q2:BG7L:FQPZ:OITF:6WOG:M3SR:GQHU:NPFN:7P2C:F3KH
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: iphydf
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support

Additional environment details (AWS, VirtualBox, physical, etc.):

Physical, but I doubt it matters.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no source files or tests; first run the two Docker build reproductions with .dockerignore patterns /o++o and /o+o. Trace the .dockerignore pattern handling that produces the syntax error or fails to ignore o+o, then add regression coverage showing both filenames are excluded from the build context.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.