mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-08-25 09:33:28 +02:00
Add arm64 docker-build
This commit is contained in:
parent
7c845e5b7d
commit
bd10329828
3 changed files with 70 additions and 12 deletions
|
@ -1,8 +1,13 @@
|
|||
FROM debian:buster-slim
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y git golang openssl curl && \
|
||||
random=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) && \
|
||||
RUN apk add --no-cache gcc git make musl-dev go openssl curl
|
||||
|
||||
# Configure Go
|
||||
ENV GOROOT /usr/lib/go
|
||||
ENV GOPATH /go
|
||||
ENV PATH /go/bin:$PATH
|
||||
|
||||
RUN random=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) && \
|
||||
openssl genrsa -des3 -passout pass:$random -out server.pass.key 2048 && \
|
||||
openssl rsa -passin pass:$random -in server.pass.key -out key.pem && \
|
||||
rm server.pass.key && \
|
||||
|
@ -10,13 +15,18 @@ RUN apt-get update && \
|
|||
-subj "/C=US/ST=VA/L=SomeCity/O=MyCompany/OU=MyDivision/CN=localhost" && \
|
||||
openssl x509 -req -days 365 -in server.csr -signkey key.pem -out server.pem
|
||||
|
||||
RUN curl -L https://dl.google.com/go/go1.17.5.linux-amd64.tar.gz -o golang.tgz && \
|
||||
tar zxvf golang.tgz && rm golang.tgz
|
||||
|
||||
RUN git clone https://github.com/bolkedebruin/rdpgw.git && \
|
||||
RUN apkArch="$(apk --print-arch)"; \
|
||||
case "$apkArch" in \
|
||||
armhf) ARCH='arm' ;; \
|
||||
aarch64) ARCH='arm64' ;; \
|
||||
x86_64) ARCH='amd64' ;; \
|
||||
x86) ARCH='386' ;; \
|
||||
*) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \
|
||||
esac && \
|
||||
git clone https://github.com/bolkedebruin/rdpgw.git && \
|
||||
cd rdpgw && \
|
||||
env GOOS=linux GOARCH=amd64 GOROOT=/go /go/bin/go mod tidy && \
|
||||
env GOOS=linux GOARCH=amd64 GOROOT=/go /go/bin/go build -trimpath -tags '' -ldflags '' -o '/rdpgw/bin/rdpgw' ./cmd/rdpgw && \
|
||||
go mod tidy && \
|
||||
go build -trimpath -tags '' -ldflags '' -o '/rdpgw/bin/rdpgw' ./cmd/rdpgw && \
|
||||
mkdir -p /opt/rdpgw && \
|
||||
mv /rdpgw/bin/rdpgw /opt/rdpgw/rdpgw && \
|
||||
rm -rf /root/go && \
|
||||
|
@ -26,7 +36,7 @@ RUN rm -rf /go
|
|||
|
||||
COPY rdpgw.yaml /opt/rdpgw/rdpgw.yaml
|
||||
|
||||
RUN useradd -m -d /opt/rdpgw -u 1001 -c "rdgw" rdgw && \
|
||||
RUN adduser --disabled-password --gecos "" -h /opt/rdpgw -u 1001 rdgw && \
|
||||
mv server.pem /opt/rdpgw/server.pem && \
|
||||
mv key.pem /opt/rdpgw/key.pem && \
|
||||
chown -R 1001 /opt/rdpgw && \
|
||||
|
|
48
dev/docker/docker-compose-arm64.yml
Normal file
48
dev/docker/docker-compose-arm64.yml
Normal file
|
@ -0,0 +1,48 @@
|
|||
version: '3.4'
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
driver: local
|
||||
realm-export.json:
|
||||
|
||||
services:
|
||||
keycloak:
|
||||
image: richardjkendall/keycloak-arm:latest
|
||||
hostname: keycloak
|
||||
volumes:
|
||||
- ${PWD}/realm-export.json:/export/realm-export.json
|
||||
environment:
|
||||
KEYCLOAK_USER: admin
|
||||
KEYCLOAK_PASSWORD: admin
|
||||
KEYCLOAK_IMPORT: /export/realm-export.json
|
||||
ports:
|
||||
- 8080:8080
|
||||
restart: on-failure
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/auth"]
|
||||
interval: 30s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 5s
|
||||
xrdp:
|
||||
hostname: xrdp
|
||||
image: rattydave/docker-ubuntu-xrdp-mate-custom:20.04
|
||||
ports:
|
||||
- 3389:3389
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- ${PWD}/xrdp_users.txt:/root/createusers.txt
|
||||
environment:
|
||||
TZ: "Europe/Amsterdam"
|
||||
rdpgw:
|
||||
build: .
|
||||
ports:
|
||||
- 9443:9443
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- keycloak
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://keycloak:8080"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
|
@ -7,7 +7,7 @@ volumes:
|
|||
|
||||
services:
|
||||
keycloak:
|
||||
image: quay.io/keycloak/keycloak:11.0.0
|
||||
image: quay.io/keycloak/keycloak:latest
|
||||
hostname: keycloak
|
||||
volumes:
|
||||
- ${PWD}/realm-export.json:/export/realm-export.json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue