Skip to content

Consider removing VOLUME directive in Dockerfiles #128

Closed
@dstearnsadobe

Description

@dstearnsadobe

The recent fix for #124 added a VOLUME directive to the Dockerfiles, which causes Docker to create a managed volume when the container is run. By default, Docker doesn't remove this volume when you remove the container. One must use docker rm --volumes ... or docker volume prune to clean up that volume, which is easy to forget.

Using the VOLUME directive in the Dockerfile also removes the ability for those running the container to choose whether a managed volume is created or not. One can always map the /var/run/openresty container directory to a Docker managed volume, or a specific host directory, using the -v flag when running the container. But if you put the VOLUME directive in the Dockerfile, that choice is removed and the volume is always created.

And unfortunately for us, our container runtime infrastructure also specifically prohibits containers that create volumes like this, so we now can't upgrade past your 1.15.8.2-2 version.

The comments in #124 imply that this directive was added to ensure that the /var/run/openresty directory is created within the container, but that could be done with a simple RUN mkdir -p /var/run/openresty instead. Would you be willing to remove the VOLUME directive and just use mkdir -p to ensure that this directory exists within the container? That way those running the container can choose whether to map that directory to a volume or not.

Thanks for considering this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions