Skip to content

Commit

Permalink
added krknctl types to krkn baseimage for global variables (#741)
Browse files Browse the repository at this point in the history
* added krknctl types to krkn baseimage for global variables

fixed

* fixed dockerfile

* dockerfile compile script

fix
  • Loading branch information
tsebastiani authored Jan 7, 2025
1 parent 667798d commit 4fea1a3
Show file tree
Hide file tree
Showing 4 changed files with 408 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- name: Build the Docker images
if: startsWith(github.ref, 'refs/tags')
run: |
./containers/compile_dockerfile.sh
docker build --no-cache -t quay.io/krkn-chaos/krkn containers/ --build-arg TAG=${GITHUB_REF#refs/tags/}
docker tag quay.io/krkn-chaos/krkn quay.io/redhat-chaos/krkn
docker tag quay.io/krkn-chaos/krkn quay.io/krkn-chaos/krkn:${GITHUB_REF#refs/tags/}
Expand All @@ -21,6 +22,7 @@ jobs:
- name: Test Build the Docker images
if: ${{ github.event_name == 'pull_request' }}
run: |
./containers/compile_dockerfile.sh
docker build --no-cache -t quay.io/krkn-chaos/krkn containers/ --build-arg PR_NUMBER=${{ github.event.pull_request.number }}
- name: Login in quay
if: startsWith(github.ref, 'refs/tags')
Expand Down
5 changes: 5 additions & 0 deletions containers/Dockerfile → containers/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ RUN python3.9 -m ensurepip
RUN pip3.9 install -r requirements.txt
RUN pip3.9 install jsonschema

LABEL krknctl.title="Krkn Base Image"
LABEL krknctl.description="This is the krkn base image."
LABEL krknctl.input_fields='$KRKNCTL_INPUT'


RUN chown -R krkn:krkn /home/krkn && chmod 755 /home/krkn
USER krkn
ENTRYPOINT ["python3.9", "run_kraken.py"]
Expand Down
5 changes: 5 additions & 0 deletions containers/compile_dockerfile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
export KRKNCTL_INPUT=$(cat krknctl-input.json|tr -d "\n")

envsubst '${KRKNCTL_INPUT}' < Dockerfile.template > Dockerfile
Loading

0 comments on commit 4fea1a3

Please sign in to comment.