-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This Dockerfile will build in Hunter and Orion into a single container image. Signed-off-by: Joe Talerico <rook@redhat.com>
- Loading branch information
Joe Talerico
committed
Jan 24, 2024
1 parent
765ec53
commit 0959ad1
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Build and Push Image | ||
on: [ push ] | ||
|
||
jobs: | ||
build: | ||
name: Build and push image | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build Orion Image | ||
id: build-orion | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: orion | ||
context: orion | ||
tags: latest ${{ github.sha }} | ||
containerfiles: | | ||
./Dockerfile | ||
- name: Push frontend image to quay.io | ||
id: push-front-to-quay | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-orion.outputs.image }} | ||
tags: ${{ steps.build-orion.outputs.tags }} | ||
registry: quay.io/cloud-bulldozer | ||
username: ${{ secrets.QUAY_USER }} | ||
password: ${{ secrets.QUAY_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM python:3.12.1-slim-bullseye | ||
# So that STDOUT/STDERR is printed | ||
ENV PYTHONUNBUFFERED="1" | ||
|
||
# We create the default user and group to run unprivileged | ||
ENV HUNTER_HOME /srv/hunter | ||
WORKDIR ${HUNTER_HOME} | ||
|
||
RUN groupadd --gid 8192 hunter && \ | ||
useradd --uid 8192 --shell /bin/false --create-home --no-log-init --gid hunter hunter && \ | ||
chown hunter:hunter ${HUNTER_HOME} | ||
|
||
# First let's just get things updated. | ||
# Install System dependencies | ||
RUN apt-get update --assume-yes && \ | ||
apt-get install -o 'Dpkg::Options::=--force-confnew' -y --force-yes -q \ | ||
git \ | ||
openssh-client \ | ||
gcc \ | ||
clang \ | ||
build-essential \ | ||
make \ | ||
curl \ | ||
virtualenv \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Get poetry package | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
# Adding poetry to PATH | ||
ENV PATH="/root/.local/bin/:$PATH" | ||
|
||
RUN git clone https://github.com/datastax-labs/hunter.git ${HUNTER_HOME} | ||
|
||
ENV PATH="${HUNTER_HOME}/bin:$PATH" | ||
|
||
RUN --mount=type=ssh \ | ||
virtualenv --python python venv && \ | ||
. venv/bin/activate && \ | ||
poetry install -v && \ | ||
mkdir -p bin && \ | ||
ln -s ../venv/bin/hunter ${HUNTER_HOME}/bin | ||
|
||
COPY --chown=hunter:hunter . orion | ||
|
||
RUN . venv/bin/activate && \ | ||
cd orion \ | ||
pip install -r requirements.txt && \ | ||
python setup.py install && \ | ||
ln -s ../venv/bin/orion ${HUNTER_HOME}/bin |