Skip to content

use central script to create user in all containers #162

Open

Description

@rwaffen

instead of adding and setting the openvox/puppet user in each container and hope to hit the smae defaults, why not make it a central implementation?

we could create a base image, or put a script in a repo and used it in all containers.

Base images could look like this: https://github.com/rwaffen/container-base/blob/main/Containerfile.alpine

or usage of a central script could look like this:

FROM docker.io/alpine:3.24 AS prepare

ENV \
    OPENVOX_GID=64604 \
    OPENVOX_UID=64604 \
    OPENVOX_USER_NAME=puppet \
    OPENVOX_GROUP_NAME=puppet \
    OPENVOX_USER_HOME=/opt/puppetlabs/server/data/puppetserver \
    OPENVOX_USER_SHELL=/sbin/nologin

RUN apk update && apk add --no-cache bash curl && \
    curl -sL https://raw.githubusercontent.com/rwaffen/container-base/refs/heads/main/prepare.sh | bash -

i think the base container would be the cleanest approach. but thought maybe have an alternative to this.

Activity

  1. miharp commented on Jun 30, 2026

    @miharp
    Contributor

    Could we use msync and https://github.com/voxpupuli/container_modulesync_configs with moduleroot/.../create-openvox-user.sh.erb in that config repo, with the canonical UID/GID in config_defaults.yml and any per-repo overrides in each repo's .sync.yml. msync then renders and commits the script into each container repo, where the Containerfile COPYs and runs it.

    I like the base image idea but seems like overkill for this specific user creation issue, my 2 cents :)

  2. rwaffen commented on Jun 30, 2026

    @rwaffen
    MemberAuthor

    ah yes... msync 🤦 ... that’s an option too. I ramped up all templates lately, so why didn't I come up tih that? :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions