Linux Installation via Docker

Swift official Docker images are hosted on hub.docker.com/_/swift. Nightly builds and previews of Swift using Docker images under the swiftlang namespace are available in the Swift Docker repository on Docker Hub.

Swift Dockerfiles are located on swift-docker repository.

Using Docker Images

  1. Pull the Docker image from Docker Hub:

    docker pull swift
    
  2. Create a container using tag latest and attach it to the container:

    docker run --privileged --interactive --tty \
    --name swift-latest swift:latest /bin/bash
    
  3. Start container swift-latest:

    docker start swift-latest
    
  4. Attach to swift-latest container:

    docker attach swift-latest