Skip to content

Commit

Permalink
update Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwindasr committed Nov 21, 2023
1 parent 695d42e commit 7b4e9c4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
9 changes: 4 additions & 5 deletions container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ RUN groupadd --gid "$USER_GID" "$USERNAME" \
WORKDIR /workspaces/art-bot

# Clone art-tools and run install.sh script
RUN git clone https://github.com/openshift-eng/art-tools.git /art-tools \
&& cd /art-tools \
RUN git clone https://github.com/openshift-eng/art-tools.git art-tools \
&& cd art-tools \
&& ./install.sh

# Install dependencies from requirements.txt
Expand All @@ -67,6 +67,5 @@ RUN cp -r /tmp/art-bot/{artbotlib,art-bot.py,art_bot_dev.py} . \
&& cp /tmp/art-bot/container/elliott-settings.yaml /home/"$USERNAME"/.config/elliott/settings.yaml \
&& rm -rf /tmp/art-bot

# Return to non-root user and final work directory
USER "$USER_UID"
WORKDIR /workspaces/art-bot
# Set non-root user
USER "$USER_UID"
11 changes: 8 additions & 3 deletions container/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ ARG USERNAME=dev
ARG USER_UID=1000
ARG USER_GID=$USER_UID

USER "$USER_UID"
# Looks like we need a USER 0 here
USER 0
# Clone art-tools and run install.sh script
RUN cd art-tools \
&& git pull \
&& ./install.sh

# install dependencies (allow even openshift's random user to see)
# Install dependencies from requirements.txt
COPY requirements.txt requirements-dev.txt ./
RUN umask a+rx && pip3 install --user --upgrade rh-doozer rh-elliott rh-artcommon -r ./requirements.txt -r ./requirements-dev.txt
RUN pip3 install --upgrade -r requirements.txt -r requirements-dev.txt

# install art-bot and default configs
COPY container/krb5-redhat.conf /etc/krb5.conf
Expand Down
19 changes: 13 additions & 6 deletions container/Dockerfile.latest
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,25 @@ FROM art-bot:base
# This build is meant to be based on an existing build and
# update just doozer, elliott, and art-bot.

# Update pip once in the start of this build
RUN pip3 install --upgrade pip

# use same non-root user from the initial install
ARG USERNAME=dev
# On Linux, replace with your actual UID, GID if not the default 1000
ARG USER_UID=1000
ARG USER_GID=$USER_UID

USER 0
WORKDIR /workspaces/art-bot

WORKDIR /art-tools
RUN git pull
RUN ./install.sh
RUN git config --global --add safe.directory /workspaces/art-bot/art-tools

# Looks like we need a USER 0 here
USER 0
# Clone art-tools and run install.sh script
RUN cd art-tools \
&& git pull \
&& ./install.sh

# Install dependencies from requirements.txt
COPY requirements.txt ./
Expand All @@ -28,5 +36,4 @@ RUN cp -r /tmp/art-bot/{artbotlib,art-bot.py,art_bot_dev.py} . \
&& rm -rf /tmp/art-bot

# Switch back to the non-root user and final work directory
USER "$USER_UID"
WORKDIR /workspaces/art-bot
USER "$USER_UID"
6 changes: 0 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
koji
slack_sdk==3.19.1
cachetools
aiohttp>=3.7.3
requests_kerberos
PyYAML
requests
slack_bolt==1.15.1
pip_system_certs
fuzzywuzzy
python-Levenshtein

0 comments on commit 7b4e9c4

Please sign in to comment.