# Use official Swift toolchain on slim Ubuntu (Jammy)
FROM swift:jammy-slim
# Install build-time dependencies (for Linux GPUImage and OpenGL)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgd-dev libjpeg-dev libpng-dev libtiff-dev \
libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev \
libv4l-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Create and set working directory
WORKDIR /workspace
# Copy source
COPY . .
# Build the project from source
RUN swift build -c release
# Default to an interactive shell so the container can be inspected
CMD ["/bin/bash"]
# Ignore git and build artifacts .git .gitignore .build .DS_Store *.swp # Node modules or other heavy local dev dirs (none required here but safe) node_modules vendor # macOS files *.icloud .Software .AppleDouble .LSOverride # SwiftPM build artifacts .swiftpm .build/ # Temporary files tmp temp log
- Exact error message and exit code - /bin/sh: 1: swift: not found - exit code: 127 - Failing command/step - [5/5] RUN swift build -c release (Dockerfile line 19) - Missing packages or files mentioned - The Swift compiler binary is not present in the image (swift not found). The base image shows swift:jammy-slim, but no Swift toolchain appears to be installed. - Version mismatch info - No explicit Swift version is shown. The build expects Swift to be installed, but the image provides no swift binary. Base image used: docker.io/library/swift:jammy-slim with a specific digest (sha256:a0d255bfd43611e642fa931ec542b2ed4134caa5eeb11c5c2090ab0de9cf2353); there is a mismatch between the expectation (Swift toolchain) and what is delivered (no Swift). Notes for remediation (concise options) - Install Swift toolchain in the Dockerfile or switch to a base image that includes Swift, e.g., a Swift-enabled image with the required Swift version. - Example quick fix: add installation steps for Swift or use a base image that ships Swift.
swift (734 stars): Swift is a high-performance system programming language, to learn more about Swi paketobuildpacks/run-jammy-base (0 stars): paketobuildpacks/build-jammy-base (0 stars): paketobuildpacks/build-jammy-full (0 stars): paketobuildpacks/run-jammy-full (0 stars): paketobuildpacks/build-jammy-tiny (0 stars): paketobuildpacks/run-jammy-tiny (1 stars): kasmweb/core-ubuntu-jammy (13 stars): Ubuntu Jammy base image for Kasm Workspaces kasmweb/ubuntu-jammy-dind (7 stars): Docker for Kasm Workspaces openwhisk/action-swift-v4.2 (0 stars): Apache OpenWhisk runtime for Swift v4.2 Actions
No results found.
# Use official Swift toolchain on slim Ubuntu (Jammy)
FROM swift:jammy-slim
# Install build-time dependencies (for Linux GPUImage and OpenGL)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgd-dev libjpeg-dev libpng-dev libtiff-dev \
libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev \
libv4l-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Install Swift toolchain (from Swift.org) to ensure swift binary is available
ENV SWIFT_VERSION=5.8
RUN apt-get update && \
apt-get install -y --no-install-recommends curl ca-certificates xz-utils && \
mkdir -p /swift && \
curl -fsSL https://download.swift.org/swift-${SWIFT_VERSION}-RELEASE/ubuntu22.04/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz -o /tmp/swift.tar.gz && \
tar -xzf /tmp/swift.tar.gz -C / --strip-components 1 && \
rm /tmp/swift.tar.gz && \
# Clean up apt caches to reduce layer size
rm -rf /var/lib/apt/lists/*
# Create and set working directory
WORKDIR /workspace
# Copy source
COPY . .
# Build the project from source
RUN swift build -c release
# Default to an interactive shell so the container can be inspected
CMD ["/bin/bash"]
- Exact error message and exit code
- curl: (22) The requested URL returned error: 404
- Exit code: 22
- Failing command/step
- Dockerfile step [3/6]:
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates xz-utils && mkdir -p /swift && curl -fsSL https://download.swift.org/swift-${SWIFT_VERSION}-RELEASE/ubuntu22.04/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz -o /tmp/swift.tar.gz && tar -xzf /tmp/swift.tar.gz -C / --strip-components 1 && rm /tmp/swift.tar.gz && rm -rf /var/lib/apt/lists/*
- Missing packages or files mentioned
- The Swift tarball URL is missing (HTTP 404): https://download.swift.org/swift-${SWIFT_VERSION}-RELEASE/ubuntu22.04/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz (for SWIFT_VERSION=5.8)
- Version mismatch info
- SWIFT_VERSION is set to 5.8, and the failing URL attempted to fetch swift-5.8-RELEASE-ubuntu22.04.tar.gz. The 404 suggests that the Swift 5.8 RELEASE tarball for Ubuntu 22.04 is not published at that path. Consider validating available Swift release tarballs for ubuntu22.04 and adjusting SWIFT_VERSION or the URL accordingly.No results found.
# Use official Swift toolchain on slim Ubuntu (Jammy)
FROM swift:jammy-slim
# Install build-time dependencies (for Linux GPUImage and OpenGL)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgd-dev libjpeg-dev libpng-dev libtiff-dev \
libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev \
libv4l-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Create and set working directory
WORKDIR /workspace
# Copy source
COPY . .
# Build the project from source
RUN swift build -c release
# Default to an interactive shell so the container can be inspected
CMD ["/bin/bash"]
swift (734 stars): Swift is a high-performance system programming language, to learn more about Swi paketobuildpacks/run-jammy-base (0 stars): paketobuildpacks/run-jammy-full (0 stars): paketobuildpacks/build-jammy-base (0 stars): paketobuildpacks/build-jammy-tiny (0 stars): paketobuildpacks/build-jammy-full (0 stars): paketobuildpacks/run-jammy-tiny (1 stars): kasmweb/core-ubuntu-jammy (13 stars): Ubuntu Jammy base image for Kasm Workspaces openwhisk/action-swift-v4.2 (0 stars): Apache OpenWhisk runtime for Swift v4.2 Actions kasmweb/ubuntu-jammy-dind (7 stars): Docker for Kasm Workspaces
swift (734 stars): Swift is a high-performance system programming language, to learn more about Swi docker/dockerfile-copy (1 stars): (deprecated) docker/docker-model-backend-llamacpp (1 stars): docker/dockerfile (125 stars): Official Dockerfile frontend images that enable building Dockerfiles with BuildK docker/desktop-docker-debug-service (0 stars): dockereng/network-test-image (2 stars): Image used in E2E test focused on networking validation docker/gordon (2 stars): docker/ecs-searchdomain-sidecar (2 stars): docker/docker-desktop-scout-desktop-module (0 stars): docker/docker-model-cli-desktop-module (1 stars):
# Use official Swift toolchain on Ubuntu Jammy (non-slim to ensure Swift is pre-installed)
FROM swift:jammy
# Install build-time dependencies (for Linux GPUImage and OpenGL)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgd-dev libjpeg-dev libpng-dev libtiff-dev \
libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev \
libv4l-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Create and set working directory
WORKDIR /workspace
# Copy source
COPY . .
# Build the project from source
RUN swift build -c release
# Default to an interactive shell so the container can be inspected
CMD ["/bin/bash"]
Concerns: The build relies on a valid SwiftPM package; if the repository lacks Package.swift or targets, the swift build may fail., COPY . . copies the entire context; consider adding a .dockerignore to avoid shipping unnecessary files. Smoke [PASS]: test -d /workspace/.build/release Smoke [PASS]: ls -1 /workspace/.build/release | head -n 5 Smoke [PASS]: swift --version