mirror of
https://github.com/xtool-org/xtool.git
synced 2026-11-16 12:31:40 +03:00
Add prebuilt Docker image
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
*
|
||||
!/Package.swift
|
||||
!/Package.resolved
|
||||
!/Sources
|
||||
!/Tests
|
||||
!/Linux
|
||||
/Linux/packages
|
||||
/Linux/staging
|
||||
@@ -81,3 +81,17 @@ jobs:
|
||||
TAG="${{ github.ref_name }}"
|
||||
gh release create "$TAG" --draft --title "v$TAG"
|
||||
gh release upload "$TAG" output/**/*.{AppImage,AppImage.zsync,app.zip,app.dSYM.zip}
|
||||
docker:
|
||||
uses: docker/github-builder/.github/workflows/build.yml@v1
|
||||
permissions:
|
||||
contents: read # to fetch the repository content
|
||||
id-token: write # for signing attestations and cache entries with GitHub OIDC
|
||||
packages: write # to push built images to GitHub Container Registry
|
||||
with:
|
||||
output: image
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
meta-images: |
|
||||
ghcr.io/xtool-org/xtool
|
||||
meta-tags: |
|
||||
type=semver,pattern={{version}}
|
||||
|
||||
+21
-3
@@ -79,11 +79,15 @@ RUN cd xadi \
|
||||
&& cp -r bin/libxadi.so /prefix/usr/lib/libxadi.so
|
||||
|
||||
|
||||
FROM build-base
|
||||
FROM build-base AS build-xtool-base
|
||||
|
||||
COPY --from=build-limd /prefix/usr /usr
|
||||
COPY --from=build-xadi /prefix/usr /usr
|
||||
|
||||
WORKDIR /xtool
|
||||
|
||||
FROM build-xtool-base AS dev
|
||||
|
||||
# Docker doesn't support FUSE
|
||||
ENV APPIMAGE_EXTRACT_AND_RUN=1
|
||||
|
||||
@@ -92,6 +96,20 @@ ENV APPIMAGE_EXTRACT_AND_RUN=1
|
||||
# socat -dd TCP-LISTEN:27015,range=127.0.0.1/32,reuseaddr,fork UNIX-CLIENT:/var/run/usbmuxd
|
||||
ENV USBMUXD_SOCKET_ADDRESS=host.docker.internal:27015
|
||||
|
||||
WORKDIR /xtool
|
||||
|
||||
CMD [ "/bin/bash" ]
|
||||
|
||||
FROM build-xtool-base AS build-xtool
|
||||
|
||||
ADD Package.swift Package.resolved /xtool/
|
||||
RUN swift package resolve
|
||||
|
||||
ADD . /xtool
|
||||
RUN ./Linux/build.sh
|
||||
|
||||
FROM swift:6.3 AS xtool
|
||||
|
||||
COPY --from=build-xtool /xtool/Linux/packages/xtool-*.AppImage /xtool/xtool.AppImage
|
||||
RUN (cd /xtool && ./xtool.AppImage --appimage-extract) \
|
||||
&& mv /xtool/squashfs-root /usr/local/xtool \
|
||||
&& rm -rf /xtool \
|
||||
&& ln -s /usr/local/xtool/AppRun /usr/local/bin/xtool
|
||||
|
||||
@@ -56,6 +56,10 @@ linux-clean:
|
||||
linux-dist:
|
||||
docker compose run --build --rm xtool Linux/build.sh
|
||||
|
||||
.PHONY: docker
|
||||
docker:
|
||||
docker build . -t ghcr.io/xtool-org/xtool:latest
|
||||
|
||||
.PHONY: mac
|
||||
# dev build for macOS
|
||||
mac: project
|
||||
|
||||
+2
-2
@@ -2,8 +2,10 @@ services:
|
||||
xtool:
|
||||
build:
|
||||
context: .
|
||||
target: dev
|
||||
volumes:
|
||||
- .:/xtool
|
||||
- .build/linux:/xtool/.build
|
||||
container_name: xtool
|
||||
stdin_open: true
|
||||
tty: true
|
||||
@@ -13,6 +15,4 @@ services:
|
||||
- seccomp:unconfined
|
||||
extra_hosts:
|
||||
# host.docker.internal doesn't exist by default on Linux hosts
|
||||
# TODO: Does this conflict with the default host on macOS?
|
||||
# we could rename this
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
Reference in New Issue
Block a user