swiftlang / swift-docker

Docker Official Image packaging for Swift
https://swift.org
Apache License 2.0
1.36k stars 182 forks source link

Install a Swift 5.8.1 toolchain in all swift-ci images #346

Closed bnbarham closed 1 year ago

bnbarham commented 1 year ago

Installs a Swift 5.8.1 toolchain into /opt/swift/<version> on each Linux platform. Removes clang since the toolchain clang can be used instead.

bnbarham commented 1 year ago

@shahmishal has some docker-compose ideas here IIUC.

With the base docker... not really. You could share a common base image, but this is the other way around - ie. we have a bunch of images that we then want to add a toolchain on top of. Could do some generator-like hackery I suppose, but I'm not sure that's really better (eg. could just have a makefile that concats a bunch of files together 😅). Another alternative would be something like edrevo/dockerfile-plus.

shahmishal commented 1 year ago

@swift-ci test

tomerd commented 1 year ago

There's no way to share this code across Dockerfiles?

some of this can be made into a script that is that can be copied & used in the docker file

bnbarham commented 1 year ago

There's no way to share this code across Dockerfiles?

some of this can be made into a script that is that can be copied & used in the docker file

Ah that's a good point. Could do that, the extra curl for Ubuntu is a little annoying but we could install based on a parameter for that script.

tomerd commented 1 year ago

the extra curl for Ubuntu is a little annoying but we could install based on a parameter for that script.

a bit less efficient from docker caching pov but we can install curl on ubuntu before the ADD and RUN commands for the script, then remove after. or even a more lazy approach, we can just include curl on these images in the main dependencies list even if we dont really need it for anything else

MaxDesiatov commented 1 year ago

@swift-ci test

bnbarham commented 1 year ago

@swift-ci test

bnbarham commented 1 year ago

@swift-ci please test

bnbarham commented 1 year ago

@swift-ci please test