New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Health check no longer uses the container's working directory #35843

Closed
MarkusMattinen opened this Issue Dec 20, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@MarkusMattinen

MarkusMattinen commented Dec 20, 2017

Description

Previously if a working directory was defined for a container, health checks would also use that as their working directory. This is no longer the case with v17.12.0-ce-rc3. Health checks now ignore the working directory configuration and just use / as their working directory.

Steps to reproduce the issue:

  1. docker run -d -w /tmp --name health_check_test --health-cmd pwd --health-interval 5s busybox tail -f /dev/null
  2. sleep 6 && docker inspect --format '{{ (index (.State.Health.Log) 0).Output }}' health_check_test

The result is also the same if the working directory and health check are defined at the image level instead of at the container level.

Describe the results you received:
Health check uses working directory /.

Describe the results you expected:
Health check should use working directory /tmp as defined in the container configuration.

Additional information you deem important (e.g. issue happens only occasionally):
Health check uses the correct working directory at least in v17.11.0-ce.

Output of docker version:

Client:
 Version:	17.12.0-ce-rc3
 API version:	1.35
 Go version:	go1.9.2
 Git commit:	80c8033
 Built:	Thu Dec 14 00:39:46 2017
 OS/Arch:	darwin/amd64

Server:
 Engine:
  Version:	17.12.0-ce-rc3
  API version:	1.35 (minimum version 1.12)
  Go version:	go1.9.2
  Git commit:	80c8033
  Built:	Thu Dec 14 00:45:43 2017
  OS/Arch:	linux/amd64
  Experimental:	true

Output of docker info:

Containers: 8
 Running: 7
 Paused: 0
 Stopped: 1
Images: 637
Server Version: 17.12.0-ce-rc3
Storage Driver: overlay2
 Backing Filesystem: extfs
 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 logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.60-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.855GiB
Name: linuxkit-025000000001
ID: RQDH:HHCP:TGAI:HZ2P:ATR2:KY3M:X3MS:52Y6:FKRB:LBBU:GARN:O4ON
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 43
 Goroutines: 70
 System Time: 2017-12-20T11:35:55.352479601Z
 EventsListeners: 2
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

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

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Dec 20, 2017

Member

Suspecting this may be related to #35661

ping @ndeloof PTAL

Member

thaJeztah commented Dec 20, 2017

Suspecting this may be related to #35661

ping @ndeloof PTAL

ndeloof added a commit to ndeloof/docker that referenced this issue Dec 20, 2017

ndeloof added a commit to ndeloof/docker that referenced this issue Dec 20, 2017

fix moby#35843 regression on health check workingdir
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof

This comment has been minimized.

Show comment
Hide comment
@ndeloof

ndeloof Dec 20, 2017

Contributor

ouch

Contributor

ndeloof commented Dec 20, 2017

ouch

AkihiroSuda added a commit that referenced this issue Dec 21, 2017

Merge pull request #35845 from ndeloof/FIX35843
fix #35843 regression on health check workingdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment