Update alpine and webproc, create automated build workflow

This commit is contained in:
2021-10-18 20:03:02 +01:00
parent d90bf041c0
commit 864b31678c
2 changed files with 23 additions and 8 deletions

18
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Build Docker Image
on:
push:
branches: master
jobs:
build:
name: Push to GHCR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login
run: echo ${{ secrets.GHCR_PAT }} | docker login ghcr.io -u dchidell --password-stdin
- name: Build
run: docker build . --file Dockerfile --tag ghcr.io/dchidell/radius-web:latest
- name: Push
run: |
docker push ghcr.io/dchidell/radius-web:latest

View File

@@ -1,22 +1,19 @@
FROM alpine:3.11 as build FROM alpine:3.14 as build
LABEL maintainer="David Chidell (dchidell@cisco.com)" LABEL maintainer="David Chidell (dchidell@cisco.com)"
ENV VERSION=201712190728
ENV TAC_PLUS_BIN=/tacacs/sbin/tac_plus
FROM build as webproc FROM build as webproc
ENV WEBPROC_VERSION 0.2.2 ENV WEBPROCVERSION 0.4.0
ENV WEBPROC_URL https://github.com/jpillora/webproc/releases/download/$WEBPROC_VERSION/webproc_linux_amd64.gz ENV WEBPROCURL https://github.com/jpillora/webproc/releases/download/v$WEBPROCVERSION/webproc_"$WEBPROCVERSION"_linux_amd64.gz
RUN apk add --no-cache curl RUN apk add --no-cache curl
RUN curl -sL $WEBPROC_URL | gzip -d - > /usr/local/bin/webproc RUN curl -sL $WEBPROC_URL | gzip -d - > /usr/local/bin/webproc
RUN chmod +x /usr/local/bin/webproc RUN chmod +x /usr/local/bin/webproc
FROM build as snmptrap FROM build as radius
RUN apk --no-cache add freeradius RUN apk --no-cache add freeradius
COPY --from=webproc /usr/local/bin/webproc /usr/local/bin/webproc COPY --from=webproc /usr/local/bin/webproc /usr/local/bin/webproc
ADD clients.conf /etc/raddb/clients.conf ADD clients.conf /etc/raddb/clients.conf
ADD users /etc/raddb/users ADD users /etc/raddb/users
ADD radiusd.conf /etc/raddb/radiusd.conf ADD radiusd.conf /etc/raddb/radiusd.conf
RUN chmod -R o-w /etc/raddb/ RUN chmod -R o-w /etc/raddb/
ENTRYPOINT ["webproc","--on-exit","restart","--config","/etc/raddb/users,/etc/raddb/clients.conf,/etc/raddb/radiusd.conf","--","radiusd","-f","-l","stdout"] ENTRYPOINT ["webproc","-o","restart","-c","/etc/raddb/users","-c", "/etc/raddb/clients.conf", "-c", "/etc/raddb/radiusd.conf","--","radiusd","-f","-l","stdout"]
EXPOSE 1812/udp 8080 EXPOSE 1812/udp 8080