Add prebuilt Docker image

This commit is contained in:
Kabir Oberai
2026-06-20 18:29:07 -04:00
Unverified
parent 5c4f3bcb05
commit e9980d7df0
5 changed files with 49 additions and 5 deletions
+8
View File
@@ -0,0 +1,8 @@
*
!/Package.swift
!/Package.resolved
!/Sources
!/Tests
!/Linux
/Linux/packages
/Linux/staging
+14
View File
@@ -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
View File
@@ -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
+4
View File
@@ -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
View File
@@ -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"