Skip to content

Commit

Permalink
Merge pull request #1 from SlothCroissant/staging
Browse files Browse the repository at this point in the history
Run as non-root, Housekeeping
  • Loading branch information
SlothCroissant authored Sep 14, 2024
2 parents 2a36d94 + 5ae9ac7 commit 24866a4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ env:
jobs:
build:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.meta.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
fetch-depth: "0"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down Expand Up @@ -69,8 +67,8 @@ jobs:
"quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.meta.outputs.tag }}"
labels: |
org.opencontainers.image.version = ${{ steps.meta.outputs.tag }}
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.meta.outputs.tag }}

8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ RUN apt-get install -y \

RUN pip install -r requirements.txt

ARG PUID=1000
ARG PGID=1000

RUN groupadd -g "${PGID}" python \
&& useradd --create-home --no-log-init -u "${PUID}" -g "${PGID}" python

USER python

CMD ["python3", "server.py"]
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,36 @@
[![proxmox-auto-installer-server on DockerHub][dockerhub-image]][dockerhub-url]
[![Docker Build][gh-actions-image]][gh-actions-url]

# Overview
# proxmox-auto-installer-server

This `Dockerfile` provides a mechanism to host `answer.toml` files, served dynamically, for Automated Proxmox VE installation via the HTTP answer file option.

Doc: https://pve.proxmox.com/wiki/Automated_Installation

> NOTE: Throughout this document, it's assumed that you are performing this on a Proxmox VE host or similar Debian/Ubuntu based solution. You *may* need to modify these steps if you are using another distro.
Builds are available at the following Docker repositories:

* Docker Hub: [docker.io/slothcroissant/proxmox-auto-installer-server](https://hub.docker.com/r/slothcroissant/proxmox-auto-installer-server)
* GitHub Container Registry: [ghcr.io/slothcroissant/proxmox-auto-installer-server](https://ghcr.io/slothcroissant/proxmox-auto-installer-server)
* Quay Container Registry: [quay.io/slothcroissant/proxmox-auto-installer-server](https://quay.io/repository/slothcroissant/proxmox-auto-installer-server)

# Run the Container

Populate a folder on the host with your .toml files (in this example, `~/Downloads/answers`). Each file should be `<mac_address>.toml` - for example `bc:24:11:d5:36:d1.toml`
Populate a folder on the host with your .toml files (in this example, `/host/path/answers`). Each file should be `<mac_address>.toml` - for example `bc:24:11:d5:36:d1.toml`

Run the container:

``` bash
docker run -p 8000:8000 --mount type=bind,source=~/Downloads/answers,target=/app/answers slothcroissant/proxmox-auto-installer-server:latest
docker run -p 8000:8000 --mount type=bind,source=/host/path/answers,target=/app/answers slothcroissant/proxmox-auto-installer-server:latest
```

| Key | Value |
|-|-|
| `-p 8000:8000` | Port (host:container) on which to expose the application. The container port is `8000`, but you can map a different port via Docker. Ref: [Docker: Expose Ports](https://docs.docker.com/engine/containers/run/#exposed-ports)|
| `--mount type=bind,source=~/Downloads/answers,target=/app/answers` | Volume (via Bind Mount) exposed into the container. This can be anywhere on your host, and should always map to `/app/answers` in the container. Ref: [Docker: Bind Mounts](https://docs.docker.com/engine/containers/run/#bind-mounts)|
| `--mount type=bind,source=/host/path/answers,target=/app/answers` | Volume (via Bind Mount) exposed into the container. This can be anywhere on your host, and should always map to `/app/answers` in the container. Ref: [Docker: Bind Mounts](https://docs.docker.com/engine/containers/run/#bind-mounts)|
| `-e PUID=<int>` (Optional) | Sets the container's User ID (PUID) in case your volume mount has dependencies on PUID/PGID and is different than the default `1000`. |
| `-e PGID=<int>` (Optional) | Sets the container's Group ID (PGID) in case your volume mount has dependencies on PUID/PGID and is different than the default `1000`. |

Take note of your docker host's IP address and exposed port (if you deviated from the default `8000`), so you can point PVE to it later.

Expand Down

0 comments on commit 24866a4

Please sign in to comment.