-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Issue The `devxci/mbtci-java21-node22` image does not contain the tools necessary to build and scan Python-based apps. On the other hand the image already contains all tools to run `mbt` and perform scans using `piper`. # Fix Add `python3`, `pip` and `pipx` to image to enable building and scanning Python-based apps.
- Loading branch information
Showing
2 changed files
with
52 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,34 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true # ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
tags: ghcr.io/${{ github.repository }}:latest |
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,18 @@ | ||
# Use the base image | ||
FROM devxci/mbtci-java21-node22 | ||
|
||
ARG MTA_USER="mta" | ||
|
||
# Switch to root user to install packages | ||
USER root | ||
|
||
# Install python3, pip, pipx | ||
RUN apt-get update && \ | ||
apt-get install -y python3 python3-pip python3-venv && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
pip install pipx && \ | ||
python3 --version && pip --version && pipx --version | ||
|
||
# Switch back to the original user | ||
USER ${MTA_USER} |