mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-12-16 16:36:17 +00:00
feat: add custom armv7 compared to amd64 and arm64 (#1007)
* feat: add separate arm/v7 building with c version * chore: change workflow step names * fix: my stupid path mistake * chore: retry sed * chore: temp comment out * chore: add libraries and choose for C on arm7 * chore: add arm64 and amd64 back * chore: streamline workflow * chore: work on the workflow * chore: try to separate matrix * revert to old method with changes * chore: remove invalid reference * chore: correct deps * chore: remove old steps * feat: add custom armv7 images (compared to arm64 and amd64) * chore: minor add go version in workflow --------- Co-authored-by: DaanSelen <dselen@systemec.nl>
This commit is contained in:
12
.github/workflows/docker.yml
vendored
12
.github/workflows/docker.yml
vendored
@@ -44,15 +44,12 @@ jobs:
|
|||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
with:
|
with:
|
||||||
platforms: |
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
- linux/amd64
|
|
||||||
- linux/arm64
|
|
||||||
# - linux/arm/v7
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Docker meta by docs https://github.com/docker/metadata-action
|
- name: Extract Docker metadata from environment
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
@@ -64,7 +61,7 @@ jobs:
|
|||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=sha,format=short,prefix=
|
type=sha,format=short,prefix=
|
||||||
|
|
||||||
- name: Build and export (multi-arch)
|
- name: Build and export Docker image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@@ -72,8 +69,7 @@ jobs:
|
|||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
#,linux/arm/v7
|
|
||||||
|
|
||||||
docker_scan:
|
docker_scan:
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
*.tar
|
||||||
.vscode
|
.vscode
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ ENV CGO_ENABLED=1
|
|||||||
# Change directory
|
# Change directory
|
||||||
WORKDIR /workspace/awg
|
WORKDIR /workspace/awg
|
||||||
# Compile the binaries
|
# Compile the binaries
|
||||||
RUN go mod download && \
|
RUN go version && \
|
||||||
|
go mod download && \
|
||||||
go mod verify && \
|
go mod verify && \
|
||||||
go build -ldflags '-linkmode external -extldflags "-fno-PIC -static"' -v -o /usr/bin
|
go build -ldflags '-linkmode external -extldflags "-fno-PIC -static"' -v -o /usr/bin
|
||||||
#
|
#
|
||||||
@@ -56,12 +57,16 @@ RUN make && chmod +x wg*
|
|||||||
# Use the python-alpine image for building pip dependencies
|
# Use the python-alpine image for building pip dependencies
|
||||||
FROM python:3.14-alpine AS pip-builder
|
FROM python:3.14-alpine AS pip-builder
|
||||||
|
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
|
||||||
# Add the build dependencies and create a Python virtual environment.
|
# Add the build dependencies and create a Python virtual environment.
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
build-base \
|
build-base \
|
||||||
pkgconfig \
|
pkgconfig \
|
||||||
python3-dev \
|
python3-dev \
|
||||||
|
postgresql-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
|
libpq \
|
||||||
linux-headers \
|
linux-headers \
|
||||||
rust \
|
rust \
|
||||||
cargo \
|
cargo \
|
||||||
@@ -70,6 +75,11 @@ RUN apk add --no-cache \
|
|||||||
|
|
||||||
# Copy the requirements file into the build layer.
|
# Copy the requirements file into the build layer.
|
||||||
COPY ./src/requirements.txt /opt/wgdashboard/src
|
COPY ./src/requirements.txt /opt/wgdashboard/src
|
||||||
|
RUN if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
|
||||||
|
sed -i "s|psycopg\[binary\]==3.2.13|psycopg\[c\]==3.2.13|" /opt/wgdashboard/src/requirements.txt; \
|
||||||
|
fi; \
|
||||||
|
cat /opt/wgdashboard/src/requirements.txt
|
||||||
|
|
||||||
# Install the pip packages
|
# Install the pip packages
|
||||||
RUN . /opt/wgdashboard/src/venv/bin/activate && \
|
RUN . /opt/wgdashboard/src/venv/bin/activate && \
|
||||||
pip3 install --upgrade pip && \
|
pip3 install --upgrade pip && \
|
||||||
@@ -133,7 +143,7 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|||||||
# Copy in the runtime script, essential.
|
# Copy in the runtime script, essential.
|
||||||
COPY ./docker/entrypoint.sh /entrypoint.sh
|
COPY ./docker/entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
#
|
# Expose ports on the container
|
||||||
EXPOSE 10086
|
EXPOSE 10086
|
||||||
WORKDIR $WGDASH/src
|
WORKDIR $WGDASH/src
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user