commit 9730392a4a9c38f37cf037d230fdbd7075eca258 Author: ebner Date: Thu Mar 27 10:40:01 2025 +0100 initial commit diff --git a/.gitea/workflows/build_push.yml b/.gitea/workflows/build_push.yml new file mode 100644 index 0000000..c4130fb --- /dev/null +++ b/.gitea/workflows/build_push.yml @@ -0,0 +1,32 @@ +name: Build and Publish Docker Image + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Show environment variables + run: | + set + + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: gitea.psi.ch + username: ${{ github.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: gitea.psi.ch/${{ github.repository }}:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..57c9a77 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM container.psi.ch/images/rhel8 + +# RUN dnf -y upgrade +RUN dnf -y group install "Development Tools" +RUN dnf -y install wget +RUN dnf -y install python3 +RUN dnf -y install python3-devel +RUN dnf -y install nodejs +RUN dnf -y install git-lfs +RUN dnf clean all +# Initialize git lfs +RUN git lfs install + +COPY files/rpmmacros /root/.rpmmacros diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..7cb95b1 --- /dev/null +++ b/Readme.md @@ -0,0 +1,36 @@ +# Overview +This is the PSI rhel8 docker developer image. It contains most developer tools especially for building rpms, etc. + + +# Usage + +The image can be used as follows: + +```bash +docker run -it --rm gitea.psi.ch/images/rhel8-developer-github-actions +``` + +To build an RPM this image can be used as follows: +```bash +docker run --platform linux/amd64 -it --rm -v $(pwd):/data --workdir /data container.psi.ch/images/rhel8-developer-github-actions rpmbuild -ba whatever.spec +``` + + +To base other images upon this image use +```dockerfile +FROM container.psi.ch/images/rhel9-developer +``` +in your Dockerfile + +# Build + +To build the image use: +```bash +docker build --platform linux/x86_64 -t container.psi.ch/images/rhel9-developer-github-actions . +``` + +To push the image to the central container registry do: +```bash +docker login gitea.psi.ch +docker push gitea.psi.ch/images/rhel8-developer-github-actions +``` \ No newline at end of file diff --git a/files/rpmmacros b/files/rpmmacros new file mode 100644 index 0000000..e47f2b9 --- /dev/null +++ b/files/rpmmacros @@ -0,0 +1,8 @@ +%_topdir %{getenv:PWD} +%_builddir %{_topdir}/BUILD +%_buildrootdir %{_topdir}/BUILDROOT +%_rpmdir %{_topdir}/RPMS +%_sourcedir %{_topdir}/SOURCES +%_specdir %{_topdir}/SPECS +%_srcrpmdir %{_topdir}/SRPMS +%packager Docker RPM Build Image