From 7eafeef0935960138182abad73e35dc4fc5053df Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Sun, 12 Nov 2023 17:28:39 +0100 Subject: [PATCH] added build of ubuntu image (#7) Reviewed-on: https://gitea.sikorski.cloud/RogerSik/docker-devops-helper/pulls/7 --- .../workflows/{dev.yaml => dev_alpine.yaml} | 5 +-- .gitea/workflows/dev_ubuntu.yaml | 31 ++++++++++++++++++ .../workflows/{main.yaml => main_alpine.yaml} | 5 +-- .gitea/workflows/main_ubuntu.yaml | 32 +++++++++++++++++++ README.md | 17 ++++++---- Dockerfile => dockerfile/alpine/Dockerfile | 0 dockerfile/ubuntu/Dockerfile | 10 ++++++ 7 files changed, 90 insertions(+), 10 deletions(-) rename .gitea/workflows/{dev.yaml => dev_alpine.yaml} (82%) create mode 100644 .gitea/workflows/dev_ubuntu.yaml rename .gitea/workflows/{main.yaml => main_alpine.yaml} (83%) create mode 100644 .gitea/workflows/main_ubuntu.yaml rename Dockerfile => dockerfile/alpine/Dockerfile (100%) create mode 100644 dockerfile/ubuntu/Dockerfile diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev_alpine.yaml similarity index 82% rename from .gitea/workflows/dev.yaml rename to .gitea/workflows/dev_alpine.yaml index 476e6c9..268169c 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev_alpine.yaml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: hadolint/hadolint-action@v3.1.0 with: - dockerfile: Dockerfile + dockerfile: dockerfile/alpine/Dockerfile build: runs-on: k3s @@ -24,7 +24,8 @@ jobs: with: image: rogersik/devops-helper registry: gitea.sikorski.cloud - tag: development + tag: dev-alpine cache: true username: rogersik password: ${{ secrets.REGISTRY_PASSWORD }} + build_file: dockerfile/alpine/Dockerfile diff --git a/.gitea/workflows/dev_ubuntu.yaml b/.gitea/workflows/dev_ubuntu.yaml new file mode 100644 index 0000000..629a328 --- /dev/null +++ b/.gitea/workflows/dev_ubuntu.yaml @@ -0,0 +1,31 @@ +name: build + +on: + push: + branches-ignore: + - main + +jobs: + Dockerfile lint: + runs-on: k3s + steps: + - uses: actions/checkout@v3 + - uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: dockerfile/ubuntu/Dockerfile + + build: + runs-on: k3s + # needs: Dockerfile lint # lets process faster pull-requests + steps: + - uses: actions/checkout@v3 + - name: Kaniko build + uses: aevea/action-kaniko@master + with: + image: rogersik/devops-helper + registry: gitea.sikorski.cloud + tag: dev-ubuntu + cache: true + username: rogersik + password: ${{ secrets.REGISTRY_PASSWORD }} + build_file: dockerfile/ubuntu/Dockerfile diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main_alpine.yaml similarity index 83% rename from .gitea/workflows/main.yaml rename to .gitea/workflows/main_alpine.yaml index e8ca6f3..bbccadd 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main_alpine.yaml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v3 - uses: hadolint/hadolint-action@v3.1.0 with: - dockerfile: Dockerfile + dockerfile: Dockerfile/alpine/ build: runs-on: k3s @@ -25,7 +25,8 @@ jobs: with: image: rogersik/devops-helper registry: gitea.sikorski.cloud - tag: latest + tag: latest-alpine cache: true username: rogersik password: ${{ secrets.REGISTRY_PASSWORD }} + build_file: dockerfile/aline/Dockerfile diff --git a/.gitea/workflows/main_ubuntu.yaml b/.gitea/workflows/main_ubuntu.yaml new file mode 100644 index 0000000..12a9c72 --- /dev/null +++ b/.gitea/workflows/main_ubuntu.yaml @@ -0,0 +1,32 @@ +name: build +on: + push: + branches: + - main + schedule: + - cron: "0 6 * * SUN" + +jobs: + Dockerfile lint: + runs-on: k3s + steps: + - uses: actions/checkout@v3 + - uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: Dockerfile/ubuntu/ + + build: + runs-on: k3s + needs: Dockerfile lint + steps: + - uses: actions/checkout@v3 + - name: Kaniko build + uses: aevea/action-kaniko@master + with: + image: rogersik/devops-helper + registry: gitea.sikorski.cloud + tag: latest-ubuntu + cache: true + username: rogersik + password: ${{ secrets.REGISTRY_PASSWORD }} + build_file: dockerfile/aline/Dockerfile diff --git a/README.md b/README.md index 2b0b6ad..cac8cef 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,25 @@ # admin-helper Container -[![Build Status](https://drone.sikorski.cloud/api/badges/RogerSik/docker-admin-helper/status.svg)](https://drone.sikorski.cloud/RogerSik/docker-admin-helper) -This image is builded to easier maintain unusually docker container tasks. +This image is builded to do easier maintaince tasks. Example editing config files (with some comfort). Installed tools: -* rsync -* mc -* nano +- rsync +- mc +- nano + +## Ubuntu and Alpine Images + +We are providing Ubuntu and Alpine images. Ubuntu for tasks where Alpine maybe is not good at. [Example "kubectl cp" larger files](https://github.com/kubernetes/kubernetes/issues/115573) # An example execution + ## Editing config files + ``` docker run --rm \ -v "home-assistant_config:/opt/docker-volume/" \ -it \ -w /opt/docker-volume/ \ rogersik/admin-helper -``` \ No newline at end of file +``` diff --git a/Dockerfile b/dockerfile/alpine/Dockerfile similarity index 100% rename from Dockerfile rename to dockerfile/alpine/Dockerfile diff --git a/dockerfile/ubuntu/Dockerfile b/dockerfile/ubuntu/Dockerfile new file mode 100644 index 0000000..7ccc803 --- /dev/null +++ b/dockerfile/ubuntu/Dockerfile @@ -0,0 +1,10 @@ +# https://hub.docker.com/_/alpine + +FROM ubuntu:22.04 + +RUN apt-get update \ + && apt-get install -y nano mc micro rsync ncdu git curl \ + && rm -rf /var/lib/apt/lists/* +COPY ./bin/ /usr/local/bin + +ENTRYPOINT ["sleep", "infinity"]