10M+
Swift is a high-performance system programming language, to learn more about Swift visit swift.org.
docker pull swift
Maintained by:
the Swift Community
Where to get help:
Swift Docker Community Forums
Dockerfile
links6.0.3-slim
, 6.0-slim
, 6.0.3-noble-slim
, 6.0-noble-slim
, noble-slim
, slim
6.0.3-amazonlinux2-slim
, 6.0-amazonlinux2-slim
, amazonlinux2-slim
6.0.3-windowsservercore-ltsc2022
, 6.0-windowsservercore-ltsc2022
, windowsservercore-ltsc2022
5.10.1-windowsservercore-ltsc2022
, 5.10-windowsservercore-ltsc2022
5.9.2-windowsservercore-ltsc2022
, 5.9-windowsservercore-ltsc2022
Where to file issues:
https://bugs.swift.org Component: Docker
Supported architectures: (more info)amd64
, arm64v8
, windows-amd64
Published image artifact details:
repo-info repo's repos/swift/
directory (history)
(image metadata, transfer size, etc)
Image updates:
official-images repo's library/swift
label
official-images repo's library/swift
file (history)
Source of this description:
docs repo's swift/
directory (history)
Swift is a high-performance system programming language. It has a clean and modern syntax, offers seamless access to existing C and Objective-C code and frameworks, and is memory safe by default.
Although inspired by Objective-C and many other languages, Swift is not itself a C-derived language. As a complete and independent language, Swift packages core features like flow control, data structures, and functions, with high-level constructs like objects, protocols, closures, and generics. Swift embraces modules, eliminating the need for headers and the code duplication they entail.
To learn more about the programming language, visit swift.org.
Swift requires a little bit of extra security privilege to run the REPL. The following command creates an ephemeral container, attaches your terminal to it and starts the Swift REPL. A great way to try out pre-release builds!
docker run --cap-add sys_ptrace -it --rm swift swift
docker pull swift
docker run -it --name swiftfun swift /bin/bash
Start your image with name swiftfun
docker start swiftfun
and then attach it
docker attach swiftfun
The swift
images come in many flavors, each designed for a specific use case.
swift:<version>
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
Some of these tags may have names like bookworm in them. These are the suite code names for releases of Debian and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Debian.
Some of these tags may have names like focal, jammy, or noble in them. These are the suite code names for releases of Ubuntu and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Ubuntu.
swift:<version>-slim
This image does not contain the common packages contained in the default tag and only contains the minimal packages needed to run swift
. Unless you are working in an environment where only the swift
image will be deployed and you have space constraints, we highly recommend using the default image of this repository.
swift:<version>-windowsservercore
This image is based on Windows Server Core (microsoft/windowsservercore
). As such, it only works in places which that image does, such as Windows 10 Professional/Enterprise (Anniversary Edition) or Windows Server 2016.
For information about how to get Docker running on Windows, please see the relevant "Quick Start" guide provided by Microsoft:
View license information for the software contained in this image.
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
Some additional license information which was able to be auto-detected might be found in the repo-info
repository's swift/
directory.
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
Docker Official Images are a curated set of Docker open source and drop-in solution repositories.
These images have clear documentation, promote best practices, and are designed for the most common use cases.