Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*
!/Package.swift
!/Package.resolved
!/Sources
!/Tests
!/Linux
/Linux/packages
/Linux/staging
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Comment on lines +96 to +97

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass the tag into the Docker build

These semver tags get pushed without passing the tag into the build. The github-builder workflow only forwards explicit build-args, and its Git context does not provide .git to SwiftPM by default; since Package.swift derives XTOOL_VERSION only from the environment or Git info and xtl_version() falls back to unversioned, every ghcr.io/xtool-org/xtool:<version> image produced here will report xtool unversioned instead of the release version.

Useful? React with 👍 / 👎.

24 changes: 21 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the usbmuxd socket default in the image

Device access regresses for the published image because this final stage starts over from swift:6.3 and never reapplies the USBMUXD_SOCKET_ADDRESS=host.docker.internal:27015 default set in the dev stage. When users run the prebuilt GHCR image with the documented socat forwarding, libusbmuxd falls back to its in-container socket instead of the host forward, so devices/install/launch cannot see attached iOS devices unless every invocation manually passes the env var.

Useful? React with 👍 / 👎.


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 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ services:
xtool:
build:
context: .
target: dev
volumes:
- .:/xtool
- .build/linux:/xtool/.build
container_name: xtool
stdin_open: true
tty: true
Expand All @@ -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"