Skip to content

podman: Rabbit config update script doesnt have permissions to modify the config file #3734

@MoralCode

Description

@MoralCode

In our rabbitmq container image, we have a script that populates the credentials in the config based on the environment variables available at build time.

I recently saw this error when rebuilding my local instance's container image in podman

STEP 15/16: COPY docker/rabbitmq/update_config.py /
--> Using cache 711eede66212dc63de0c796c17811c96cd2dfec5f98c5ab608ea2259c77debd5
--> 711eede66212
STEP 16/16: RUN exec python3 update_config.py
Traceback (most recent call last):
  File "//update_config.py", line 40, in <module>
    with config_file.open("w") as file:
         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/pathlib.py", line 1013, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/etc/rabbitmq/definitions.json'
Error: building at STEP "RUN exec python3 update_config.py": while running runtime: exit status 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    containersRelated to augur in containers, container images, or the compose file, either in podman or in docker

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions