docker: add dockerfile variants for go1.19 vs go1.23

This commit is contained in:
mappu 2024-09-03 18:24:44 +12:00
parent 3aba55b9f9
commit d7ccbe3c17
5 changed files with 39 additions and 1 deletions

View File

@ -74,7 +74,7 @@ Some C++ idioms that were difficult to project were omitted from the binding. Bu
### Q7. How can I compile for Windows from a Linux host OS?
1. Build the necessary docker container for cross-compilation:
- `docker build -t miqt/win64-cross:latest -f win64-cross-qt-mxe-static.Dockerfile .`
- `docker build -t miqt/win64-cross:latest -f win64-cross-go1.23-qt5.15-static.Dockerfile .`
2. Build your application:
- `docker run --rm -v $(pwd):/src -w /src miqt/win64-cross:latest go build -buildvcs=false -ldflags '-s -w -H windowsgui'`

View File

@ -0,0 +1,19 @@
FROM golang:1.23-bookworm
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -qyy gnupg2 ca-certificates
RUN DEBIAN_FRONTEND=noninteractive \
echo "deb https://pkg.mxe.cc/repos/apt buster main" >/etc/apt/sources.list.d/mxeapt.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9 && \
apt-get update && \
apt-get install -qyy mxe-x86-64-w64-mingw32.shared-qt5 && \
apt-get clean
ENV PATH=/usr/lib/mxe/usr/bin:$PATH
ENV CXX=x86_64-w64-mingw32.shared-g++
ENV CC=x86_64-w64-mingw32.shared-gcc
ENV PKG_CONFIG=x86_64-w64-mingw32.shared-pkg-config
ENV GOOS=windows
ENV CGO_ENABLED=1

View File

@ -0,0 +1,19 @@
FROM golang:1.23-bookworm
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -qyy gnupg2 ca-certificates
RUN DEBIAN_FRONTEND=noninteractive \
echo "deb https://pkg.mxe.cc/repos/apt buster main" >/etc/apt/sources.list.d/mxeapt.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9 && \
apt-get update && \
apt-get install -qyy mxe-x86-64-w64-mingw32.static-qt5 && \
apt-get clean
ENV PATH=/usr/lib/mxe/usr/bin:$PATH
ENV CXX=x86_64-w64-mingw32.static-g++
ENV CC=x86_64-w64-mingw32.static-gcc
ENV PKG_CONFIG=x86_64-w64-mingw32.static-pkg-config
ENV GOOS=windows
ENV CGO_ENABLED=1