github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/caas/Dockerfile (about)

     1  FROM public.ecr.aws/ubuntu/ubuntu:22.04
     2  ARG TARGETOS
     3  ARG TARGETARCH
     4  
     5  # Add the syslog user for audit logging.
     6  RUN useradd --system --no-create-home --shell /usr/sbin/nologin syslog
     7  # Add the juju and sjuju user for rootless agents.
     8  # 170 and 171 uid/gid must be updated here and in caas/kubernetes/provider/constants/constants.go
     9  RUN groupadd --gid 170 juju
    10  RUN useradd --uid 170 --gid 170 --no-create-home --shell /usr/bin/bash juju
    11  RUN groupadd --gid 171 sjuju
    12  RUN useradd --uid 171 --gid 171 --no-create-home --shell /usr/bin/bash sjuju
    13  RUN mkdir -p /etc/sudoers.d && echo "sjuju ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/sjuju
    14  
    15  # Some Python dependencies.
    16  RUN apt-get update \
    17      && apt-get install -y --no-install-recommends \
    18      sudo \
    19      python3-yaml \
    20      python3-pip \
    21      python3-distutils \
    22      # for debug-hooks.
    23      tmux byobu \
    24      # below apt dependencies are required by controller pod.
    25      iproute2 \
    26      curl \
    27      && pip3 install --upgrade pip setuptools \
    28      && rm -rf /var/lib/apt/lists/* \
    29      && rm -rf /root/.cache
    30  
    31  # Install the standard charm dependencies.
    32  ENV WHEELHOUSE=/tmp/wheelhouse
    33  ENV PIP_WHEEL_DIR=/tmp/wheelhouse
    34  ENV PIP_FIND_LINKS=/tmp/wheelhouse
    35  
    36  RUN mkdir -p /tmp/wheelhouse
    37  COPY docker-staging/requirements.txt /tmp/wheelhouse/requirements.txt
    38  RUN pip3 install -r /tmp/wheelhouse/requirements.txt
    39  
    40  WORKDIR /var/lib/juju
    41  COPY ${TARGETOS}_${TARGETARCH}/bin/jujud /opt/
    42  COPY ${TARGETOS}_${TARGETARCH}/bin/jujuc /opt/
    43  COPY ${TARGETOS}_${TARGETARCH}/bin/containeragent /opt/
    44  COPY ${TARGETOS}_${TARGETARCH}/bin/pebble /opt/
    45  
    46  ENTRYPOINT ["sh", "-c"]