From f5fbb1ce2aca0c57466a8c2379ebf4b3ea078892 Mon Sep 17 00:00:00 2001 From: davma-io Date: Sun, 16 Jul 2023 19:46:06 +0200 Subject: [PATCH 1/7] ci(image-build): add debian-base --- .github/workflows/debian.yml | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/debian.yml diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml new file mode 100644 index 0000000..d0f998b --- /dev/null +++ b/.github/workflows/debian.yml @@ -0,0 +1,45 @@ +name: debian-base + +on: + push: + branches: + # - 'main' + - 'test-packages' + paths: + - "base-images/debian/**" + - "!base-images/debian/README.md" + +env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Read version from file + id: version + run: echo "::set-output name=VERSION::$(cat ./base-images/debian/version.txt)" + + - name: Build and push Docker image + env: + DOCKERFILE_PATH: base-images/debian/Dockerfile + IMAGE_TAG: ${{ steps.version.outputs.VERSION }} + IMAGE_ARG: debian:latest + IMAGE_REF: kubespacedev/debian:${{ steps.version.outputs.VERSION }} + IMAGE_LAST: kubespacedev/debian:latest + run: | + docker build -t ${{ env.IMAGE_REF }} --build-arg IMAGE=${{ env.IMAGE_ARG }} -f ${{ env.DOCKERFILE_PATH }} . + docker push ${{ env.IMAGE_REF }} + docker tag ${{ env.IMAGE_REF }} ${{ env.IMAGE_LAST }} + docker push ${{ env.IMAGE_LAST }} \ No newline at end of file From 67f94c37e68d71c9eea7f64b986f3f4fdd3bbc49 Mon Sep 17 00:00:00 2001 From: davma-io Date: Sun, 16 Jul 2023 19:49:45 +0200 Subject: [PATCH 2/7] feat(image-components): add debian image components --- base-images/debian/.dockerignore | 34 ++++++++++++++++++++++++ base-images/debian/.gitignore | 44 ++++++++++++++++++++++++++++++++ base-images/debian/Dockerfile | 34 ++++++++++++++++++++++++ base-images/debian/README.md | 1 + base-images/debian/version.txt | 1 + 5 files changed, 114 insertions(+) create mode 100644 base-images/debian/.dockerignore create mode 100644 base-images/debian/.gitignore create mode 100644 base-images/debian/Dockerfile create mode 100644 base-images/debian/README.md create mode 100644 base-images/debian/version.txt diff --git a/base-images/debian/.dockerignore b/base-images/debian/.dockerignore new file mode 100644 index 0000000..3edb0b5 --- /dev/null +++ b/base-images/debian/.dockerignore @@ -0,0 +1,34 @@ +# Include any files or directories that you don't want to be copied to your +# container here (e.g., local build artifacts, temporary files, etc.). +# +# For more help, visit the .dockerignore file reference guide at +# https://docs.docker.com/engine/reference/builder/#dockerignore-file + +**/.DS_Store +**/__pycache__ +**/.venv +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md diff --git a/base-images/debian/.gitignore b/base-images/debian/.gitignore new file mode 100644 index 0000000..874d26a --- /dev/null +++ b/base-images/debian/.gitignore @@ -0,0 +1,44 @@ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +.jenkins-external \ No newline at end of file diff --git a/base-images/debian/Dockerfile b/base-images/debian/Dockerfile new file mode 100644 index 0000000..76fbc1b --- /dev/null +++ b/base-images/debian/Dockerfile @@ -0,0 +1,34 @@ +ARG IMAGE +FROM ${IMAGE} + +# Switch to root user for system updates +USER root + +# Install locales +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y locales tzdata && \ + rm -rf /var/lib/apt/lists/* && \ + localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \ + ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime && \ + dpkg-reconfigure -f noninteractive tzdata + +# Set environment variables +ENV LANG en_US.utf8 + +# Install basic libraries +RUN apt-get update && \ + apt-get install -y curl wget && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Create a non-root user +RUN useradd -m -s /bin/bash kube + +USER kube +# Set the working directory to the 'kube' user's home directory +WORKDIR /home/kube + +# Default command when starting the container +CMD ["/bin/bash"] \ No newline at end of file diff --git a/base-images/debian/README.md b/base-images/debian/README.md new file mode 100644 index 0000000..ac44d9a --- /dev/null +++ b/base-images/debian/README.md @@ -0,0 +1 @@ +docker build -t debian-testu -f base-images/ubuntu/Dockerfile --build-arg IMAGE=debian:latest . \ No newline at end of file diff --git a/base-images/debian/version.txt b/base-images/debian/version.txt new file mode 100644 index 0000000..8a9ecc2 --- /dev/null +++ b/base-images/debian/version.txt @@ -0,0 +1 @@ +0.0.1 \ No newline at end of file From 90bdddfcac753f666001092d33bc8277b3308a86 Mon Sep 17 00:00:00 2001 From: davma-io Date: Sun, 16 Jul 2023 19:53:13 +0200 Subject: [PATCH 3/7] ci(image-build): update debian on.push.branches 'main' --- .github/workflows/debian.yml | 4 ++-- base-images/debian/version.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index d0f998b..79f6336 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -3,8 +3,8 @@ name: debian-base on: push: branches: - # - 'main' - - 'test-packages' + - 'main' + # - 'test-packages' paths: - "base-images/debian/**" - "!base-images/debian/README.md" diff --git a/base-images/debian/version.txt b/base-images/debian/version.txt index 8a9ecc2..afaf360 100644 --- a/base-images/debian/version.txt +++ b/base-images/debian/version.txt @@ -1 +1 @@ -0.0.1 \ No newline at end of file +1.0.0 \ No newline at end of file From 9cdded9846fb8f38eae46f91d082bb2f416810e7 Mon Sep 17 00:00:00 2001 From: davma-io Date: Tue, 18 Jul 2023 23:42:24 +0200 Subject: [PATCH 4/7] ci(image-build): add vault --- .github/workflows/vault.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/vault.yml diff --git a/.github/workflows/vault.yml b/.github/workflows/vault.yml new file mode 100644 index 0000000..1179394 --- /dev/null +++ b/.github/workflows/vault.yml @@ -0,0 +1,45 @@ +name: vault + +on: + push: + branches: + # - 'main' + - 'test-packages' + paths: + - "vault/**" + - "!vault/README.md" + +env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Read version from file + id: version + run: echo "::set-output name=VERSION::$(cat ./vault/version.txt)" + + - name: Build and push Docker image + env: + DOCKERFILE_PATH: vault/Dockerfile + IMAGE_TAG: ${{ steps.version.outputs.VERSION }} + IMAGE_ARG: kubespacedev/ubuntu:latest + IMAGE_REF: kubespacedev/vault:${{ steps.version.outputs.VERSION }} + IMAGE_LAST: kubespacedev/vault:latest + run: | + docker build -t ${{ env.IMAGE_REF }} --build-arg IMAGE=${{ env.IMAGE_ARG }} -f ${{ env.DOCKERFILE_PATH }} . + docker push ${{ env.IMAGE_REF }} + docker tag ${{ env.IMAGE_REF }} ${{ env.IMAGE_LAST }} + docker push ${{ env.IMAGE_LAST }} \ No newline at end of file From d98b1896d8be3fd98ae6bb2c64b6360d3cb57b23 Mon Sep 17 00:00:00 2001 From: davma-io Date: Tue, 18 Jul 2023 23:43:13 +0200 Subject: [PATCH 5/7] feat(image-components): add vault image components --- vault/.dockerignore | 34 ++++++++++++++++++++++++++++++++++ vault/.gitignore | 44 ++++++++++++++++++++++++++++++++++++++++++++ vault/Dockerfile | 25 +++++++++++++++++++++++++ vault/README.md | 0 vault/config.hcl | 15 +++++++++++++++ vault/start-vault.sh | 2 ++ vault/version.txt | 1 + 7 files changed, 121 insertions(+) create mode 100644 vault/.dockerignore create mode 100644 vault/.gitignore create mode 100644 vault/Dockerfile create mode 100644 vault/README.md create mode 100644 vault/config.hcl create mode 100644 vault/start-vault.sh create mode 100644 vault/version.txt diff --git a/vault/.dockerignore b/vault/.dockerignore new file mode 100644 index 0000000..3edb0b5 --- /dev/null +++ b/vault/.dockerignore @@ -0,0 +1,34 @@ +# Include any files or directories that you don't want to be copied to your +# container here (e.g., local build artifacts, temporary files, etc.). +# +# For more help, visit the .dockerignore file reference guide at +# https://docs.docker.com/engine/reference/builder/#dockerignore-file + +**/.DS_Store +**/__pycache__ +**/.venv +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md diff --git a/vault/.gitignore b/vault/.gitignore new file mode 100644 index 0000000..874d26a --- /dev/null +++ b/vault/.gitignore @@ -0,0 +1,44 @@ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +.jenkins-external \ No newline at end of file diff --git a/vault/Dockerfile b/vault/Dockerfile new file mode 100644 index 0000000..114b512 --- /dev/null +++ b/vault/Dockerfile @@ -0,0 +1,25 @@ +ARG IMAGE +FROM ${IMAGE} + +USER root +WORKDIR / + +RUN apt-get update && apt-get install -y gpg unzip +RUN wget https://releases.hashicorp.com/vault/1.14.0-rc1/vault_1.14.0-rc1_linux_amd64.zip && \ + unzip vault_1.14.0-rc1_linux_amd64.zip -d /usr/local/bin/ && \ + rm vault_1.14.0-rc1_linux_amd64.zip && \ + apt-get remove -y unzip && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +EXPOSE 8200 +EXPOSE 8201 + +USER kube +WORKDIR /home/kube + +COPY vault/config.hcl config.hcl +COPY vault/start-vault.sh start-vault.sh + +CMD ["sh","start-vault.sh"] \ No newline at end of file diff --git a/vault/README.md b/vault/README.md new file mode 100644 index 0000000..e69de29 diff --git a/vault/config.hcl b/vault/config.hcl new file mode 100644 index 0000000..1395e5c --- /dev/null +++ b/vault/config.hcl @@ -0,0 +1,15 @@ +ui = true +disable_mlock = true + +storage "file" { + path = "./vault/data" + node_id = "node1" +} + +listener "tcp" { + address = "0.0.0.0:8200" + tls_disable = "true" +} + +api_addr = "http://0.0.0.0:8200" +cluster_addr = "https://0.0.0.0:8201" \ No newline at end of file diff --git a/vault/start-vault.sh b/vault/start-vault.sh new file mode 100644 index 0000000..9ebc2f2 --- /dev/null +++ b/vault/start-vault.sh @@ -0,0 +1,2 @@ +#!/bin/bash +vault server -config=config.hcl \ No newline at end of file diff --git a/vault/version.txt b/vault/version.txt new file mode 100644 index 0000000..8dbfd50 --- /dev/null +++ b/vault/version.txt @@ -0,0 +1 @@ +vault-ui-1.14.0-rc1 \ No newline at end of file From 32ba6a8188dac695d0f1104bb0e727464ca416d9 Mon Sep 17 00:00:00 2001 From: davma-io Date: Mon, 24 Jul 2023 19:50:36 +0200 Subject: [PATCH 6/7] ci(image-build): update vault on.push.branches 'main' --- .github/workflows/vault.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vault.yml b/.github/workflows/vault.yml index 1179394..d34b033 100644 --- a/.github/workflows/vault.yml +++ b/.github/workflows/vault.yml @@ -3,8 +3,8 @@ name: vault on: push: branches: - # - 'main' - - 'test-packages' + - 'main' + # - 'test-packages' paths: - "vault/**" - "!vault/README.md" From f1ffbb185e923d3f3c4ba407fe29c6fbd173a309 Mon Sep 17 00:00:00 2001 From: davma-io Date: Mon, 24 Jul 2023 19:54:02 +0200 Subject: [PATCH 7/7] build(image-version): update the vault version to the latest official version --- vault/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vault/version.txt b/vault/version.txt index 8dbfd50..93a481b 100644 --- a/vault/version.txt +++ b/vault/version.txt @@ -1 +1 @@ -vault-ui-1.14.0-rc1 \ No newline at end of file +ui-1.14.0-rc1 \ No newline at end of file