Skip to content

Bug: unable to tail /var/log/nginx/access.log: tomb: still alive #191

@Enteee

Description

@Enteee

With version 0.7.0, when I try to tail nginx's /var/log/nginx/access.log to stdout using -stdout /var/log/nginx/access.log, instead of printing the access log, I get for each request a line:

 Warning: unable to tail /var/log/nginx/access.log: tomb: still alive

This repeats ~30 times until dockerize finally stops nginx and the container crashes.

Minimal reproducible example

  • Dockerfile
ARG debian_version=10.13
FROM debian:${debian_version} AS build

MAINTAINER Ente "ducksource@duckpond.ch"

# Build dockerize
ARG dockerize_version=0.7.0
RUN set -ex \
  && apt-get update \
  && DEBIAN_FRONTEND=noninteractive \
    apt-get install --no-install-recommends --no-install-suggests -y \
      wget ca-certificates \
      inotify-tools \
  && wget \
    "https://github.com/jwilder/dockerize/releases/download/v${dockerize_version}/dockerize-linux-amd64-v${dockerize_version}.tar.gz" \
  && tar -C "/usr/local/bin" -xzvf "dockerize-linux-amd64-v${dockerize_version}.tar.gz" \
  && rm "dockerize-linux-amd64-v${dockerize_version}.tar.gz"

FROM debian:${debian_version}

# Install dockerize
RUN set -ex \
  && apt-get update \
  && DEBIAN_FRONTEND=noninteractive \
    apt-get install --no-install-recommends --no-install-suggests -y \
      inotify-tools
COPY --from=build  /usr/local/bin/dockerize /usr/local/bin/dockerize
  1. Build container: docker build .
  2. Run dockerize in container
$ docker run -ti <image_id> bash

root@32e1af5fc110:/service# touch stdout
root@32e1af5fc110:/service# dockerize -stdout stdout
  1. Then in a new terminal:
$ docker exec -ti $(docker ps -q) bash
root@32e1af5fc110:/service# echo "AA" > stdout
  1. Check output of first terminal:
root@32e1af5fc110:/service# dockerize -stdout stdout 
2023/06/11 08:39:29 Warning: unable to tail stdout: tomb: still alive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions