Skip to content

al45tair/swift-docker

This branch is 3 commits ahead of, 16 commits behind swiftlang/swift-docker:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0c645ca · Mar 3, 2025
Aug 30, 2024
Oct 28, 2021
Oct 28, 2021
Oct 28, 2021
Oct 28, 2021
Oct 28, 2021
Oct 28, 2021
Dec 3, 2024
Oct 28, 2021
Oct 28, 2021
Oct 28, 2021
Feb 10, 2022
Sep 2, 2022
May 18, 2023
Jul 21, 2023
Nov 12, 2024
Dec 12, 2024
Mar 13, 2023
Apr 14, 2024
Oct 23, 2021
May 30, 2022
May 18, 2023
May 18, 2023
Mar 27, 2024
Nov 13, 2024
Feb 6, 2025
Feb 19, 2025
Mar 3, 2025
Aug 22, 2024
Nov 20, 2018
Nov 8, 2019
Jul 26, 2024
Feb 14, 2025

Repository files navigation

swift-docker

Swift logo

Docker images for Swift.

You can find the Docker Hub repo here: https://hub.docker.com/_/swift/

Nightly image tags are published here: https://hub.docker.com/r/swiftlang/swift

Usage

Pull the Docker image from Docker Hub:
docker pull swift
Create a container from the image and run it:
docker run -it swift /bin/bash

If you want to run the Swift REPL you will need to run the container with additional privileges:

# If running Docker on Linux:
docker run --security-opt seccomp=unconfined -it swift

# If running Docker on macOS:
docker run --privileged -it swift

We also provide a "slim" image. Slim images are images designed just for running an already built Swift program. Consequently, they do not contain the Swift compiler.

The normal and slim images can be combined via a multi-stage Dockerfile to produce a lighter-weight image ready for deployment. For example:

FROM swift:latest as builder
WORKDIR /root
COPY . .
RUN swift build -c release

FROM swift:slim
WORKDIR /root
COPY --from=builder /root .
CMD [".build/release/docker-test"]

Contributing

Welcome to the Swift community!

Contributions to swift-docker are welcomed and encouraged! Please see the Contributing to Swift guide and check out the structure of the community.

To be a truly great community, Swift needs to welcome developers from all walks of life, with different backgrounds, and with a wide range of experience. A diverse and friendly community will have more great ideas, more unique perspectives, and produce more great code. We will work diligently to make the Swift community welcoming to everyone.

To give clarity of what is expected of our members, Swift has adopted the code of conduct defined by the Contributor Covenant. This document is used across many open source communities, and we think it articulates our values well. For more, see the Code of Conduct.

License

swift-docker is licensed under the Apache License, Version 2.0.

About

Docker Official Image packaging for Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 98.7%
  • Other 1.3%