generated from gns3/vnc-template
Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
680ee425d3 |
3 changed files with 26 additions and 71 deletions
|
@ -1,47 +0,0 @@
|
|||
name: Build Docker Image on Commit v4
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- winbox4
|
||||
tags:
|
||||
- '!' # Exclude tags
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: docker-builder
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set REPO_VARS
|
||||
id: repo-url
|
||||
run: |
|
||||
echo "REPO_HOST=$(echo "${{ github.server_url }}" | sed 's~http[s]*://~~g')" >> $GITHUB_ENV
|
||||
echo "REPO_PATH=${{ github.repository }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver: docker-container
|
||||
driver-opts: |
|
||||
network=host
|
||||
|
||||
- name: Login to OCI registry
|
||||
run: |
|
||||
echo "${{ secrets.OCI_TOKEN }}" | docker login $REPO_HOST -u "${{ secrets.OCI_USER }}" --password-stdin
|
||||
|
||||
- name: Build and push multi-arch Docker images
|
||||
run: |
|
||||
docker buildx build \
|
||||
--platform linux/amd64 \
|
||||
--tag $REPO_HOST/$REPO_PATH:${{ github.sha }} \
|
||||
--tag $REPO_HOST/$REPO_PATH:nightly-v4 \
|
||||
--push \
|
||||
.
|
||||
|
||||
- name: Cleanup
|
||||
run: |
|
||||
docker buildx prune -f
|
||||
docker logout $REPO_HOST
|
30
Dockerfile
30
Dockerfile
|
@ -1,29 +1,15 @@
|
|||
FROM alpine:latest as builder
|
||||
|
||||
RUN apk add --no-cache unzip wget
|
||||
RUN wget -O /tmp/WinBox_Linux.zip https://download.mikrotik.com/routeros/winbox/4.0beta22/WinBox_Linux.zip && \
|
||||
unzip /tmp/WinBox_Linux.zip -d /tmp/winbox && \
|
||||
|
||||
wget -O /tmp/upx.tar.xz https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-amd64_linux.tar.xz && \
|
||||
tar -xf /tmp/upx.tar.xz -C /tmp && \
|
||||
mv /tmp/winbox/WinBox /WinBox && \
|
||||
/tmp/upx-5.0.1-amd64_linux/upx --lzma /WinBox
|
||||
|
||||
FROM git.merith.xyz/gns3/base-vnc:latest
|
||||
|
||||
RUN apk add --no-cache wget
|
||||
RUN apk add --no-cache wine wget
|
||||
|
||||
COPY --from=builder /WinBox /WinBox
|
||||
# Pre-download Winbox
|
||||
RUN wget -O /winbox64.exe https://download.mikrotik.com/routeros/winbox/3.42/winbox64.exe
|
||||
|
||||
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-2.35-r1.apk && \
|
||||
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-bin-2.35-r1.apk && \
|
||||
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-i18n-2.35-r1.apk && \
|
||||
apk add --allow-untrusted glibc-2.35-r1.apk glibc-bin-2.35-r1.apk glibc-i18n-2.35-r1.apk && \
|
||||
/usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8 && \
|
||||
echo "export LANG=en_US.UTF-8" >> /etc/profile.d/glibc.sh && \
|
||||
echo "export LC_ALL=en_US.UTF-8" >> /etc/profile.d/glibc.sh && \
|
||||
rm glibc-2.35-r1.apk glibc-bin-2.35-r1.apk glibc-i18n-2.35-r1.apk && \
|
||||
rm -rf /var/cache/apk/*
|
||||
# Preload Wine Mono
|
||||
RUN mkdir -p /usr/share/wine/mono && \
|
||||
wget https://dl.winehq.org/wine/wine-mono/9.0.0/wine-mono-9.0.0-x86.msi -O /usr/share/wine/mono/wine-mono.msi && \
|
||||
wineboot --init && \
|
||||
wine msiexec /i /usr/share/wine/mono/wine-mono.msi /qn
|
||||
|
||||
COPY ./entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
|
@ -1,3 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
/WinBox
|
||||
# Wait until internet is available
|
||||
while ! ping -c1 1.1.1.1 &>/dev/null; do
|
||||
echo "Waiting for internet connection..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
if [ ! -f "/winbox64.exe" ]; then
|
||||
echo "Winbox executable not found in /data. Downloading..."
|
||||
wget -O /winbox64.exe https://download.mikrotik.com/routeros/winbox/3.42/winbox64.exe
|
||||
fi
|
||||
|
||||
while true; do
|
||||
echo "Starting Winbox..."
|
||||
wine64 /winbox64.exe
|
||||
echo "Winbox closed. Restarting in 3 seconds..."
|
||||
sleep 3
|
||||
done
|
Loading…
Reference in a new issue