docker: build from root repo context, to allow embedding other files

This commit is contained in:
mappu 2024-10-20 18:01:37 +13:00
parent d639160886
commit 8a0c7029ed
2 changed files with 6 additions and 6 deletions

View File

@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Linux64 docker build - name: Linux64 docker build
run: cd docker && docker build -t miqt/genbindings:latest -f genbindings.Dockerfile . run: docker build -t miqt/genbindings:latest -f docker/genbindings.Dockerfile .
- name: Cache clang ASTs - name: Cache clang ASTs
uses: actions/cache@v4 uses: actions/cache@v4
@ -37,7 +37,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Linux64 docker build - name: Linux64 docker build
run: cd docker && docker build -t miqt/linux64:latest -f linux64-go1.19-qt5.15-dynamic.Dockerfile . run: docker build -t miqt/linux64:latest -f docker/linux64-go1.19-qt5.15-dynamic.Dockerfile .
- name: Cache GOCACHE - name: Cache GOCACHE
uses: actions/cache@v4 uses: actions/cache@v4
@ -62,7 +62,7 @@ jobs:
key: win64-gocache key: win64-gocache
- name: Win64 docker build - name: Win64 docker build
run: cd docker && docker build -t miqt/win64:latest -f win64-cross-go1.23-qt5.15-static.Dockerfile . run: docker build -t miqt/win64:latest -f docker/win64-cross-go1.23-qt5.15-static.Dockerfile .
- name: Win64 bindings compile - name: Win64 bindings compile
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win64:latest /bin/bash -c 'cd qt && go build' run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win64:latest /bin/bash -c 'cd qt && go build'

View File

@ -149,14 +149,14 @@ Static builds are also available by installing the `mingw-w64-ucrt-x86_64-qt5-st
For static builds (open source application): For static builds (open source application):
1. Build the necessary docker container for cross-compilation: 1. Build the necessary docker container for cross-compilation:
- `docker build -t miqt/win64-cross:latest -f win64-cross-go1.23-qt5.15-static.Dockerfile .` - `docker build -t miqt/win64-cross:latest -f docker/win64-cross-go1.23-qt5.15-static.Dockerfile .`
2. Build your application: 2. Build your application:
- `docker run --rm -v $(pwd):/src -w /src miqt/win64-cross:latest go build -buildvcs=false --tags=windowsqtstatic -ldflags '-s -w -H windowsgui'` - `docker run --rm -v $(pwd):/src -w /src miqt/win64-cross:latest go build -buildvcs=false --tags=windowsqtstatic -ldflags '-s -w -H windowsgui'`
For dynamically-linked builds (closed-source or open source application): For dynamically-linked builds (closed-source or open source application):
1. Build the necessary docker container for cross-compilation: 1. Build the necessary docker container for cross-compilation:
- `docker build -t miqt/win64-dynamic:latest -f win64-cross-go1.23-qt5.15-dynamic.Dockerfile .` - `docker build -t miqt/win64-dynamic:latest -f docker/win64-cross-go1.23-qt5.15-dynamic.Dockerfile .`
2. Build your application: 2. Build your application:
- `docker run --rm -v $(pwd):/src -w /src miqt/win64-dynamic:latest go build -buildvcs=false -ldflags '-s -w -H windowsgui'` - `docker run --rm -v $(pwd):/src -w /src miqt/win64-dynamic:latest go build -buildvcs=false -ldflags '-s -w -H windowsgui'`
3. Copy necessary Qt LGPL libraries and plugin files. 3. Copy necessary Qt LGPL libraries and plugin files.
@ -179,7 +179,7 @@ Miqt supports compiling for Android. Some extra steps are required to bridge the
- Ensure to `import "C"`. - Ensure to `import "C"`.
- Check `examples/android` to see how to support both Android and desktop platforms. - Check `examples/android` to see how to support both Android and desktop platforms.
2. Build the necessary docker container for cross-compilation: 2. Build the necessary docker container for cross-compilation:
- `docker build -t miqt/android:latest -f android-armv8a-go1.23-qt5.15-dynamic.Dockerfile .` - `docker build -t miqt/android:latest -f docker/android-armv8a-go1.23-qt5.15-dynamic.Dockerfile .`
3. Build your application as `.so` format: 3. Build your application as `.so` format:
- `docker run --rm -v $(pwd):/src -w /src miqt/android:latest go build -buildmode c-shared -ldflags "-s -w -extldflags -Wl,-soname,my_go_app.so" -o android-build/libs/arm64-v8a/my_go_app.so` - `docker run --rm -v $(pwd):/src -w /src miqt/android:latest go build -buildmode c-shared -ldflags "-s -w -extldflags -Wl,-soname,my_go_app.so" -o android-build/libs/arm64-v8a/my_go_app.so`
4. Build the Qt linking stub: 4. Build the Qt linking stub: