Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Refactor Dockerfiles #328

Closed
Closed
@kazk

Description

@kazk

Dockerfiles need to be refactored to reduce image sizes, follow best practices and ensure reproducibility.

Example

codewars/swift-runner

Problems

  • Download size is 2.7 GB 😱
  • Swift version not specified 😱

Possible Solutions

  • Download (L33), build (L45) and remove (L49) in the same layer.

    # L33
    RUN git clone https://github.com/apple/swift.git && ./swift/utils/update-checkout --clone
    # 783.3 MB
    
    # L45
    RUN utils/build-script --preset-file=codewars-build-presets.ini --preset=codewars_linux_1404 install_destdir=$SWIFT_GEN_DIR installable_package=$SWIFT_GEN_DIR/swift.tar.gz
    # 944.1 MB
    
    # L49
    RUN rm -rf $SWIFT_SOURCE_DIR/*
  • Find a better way to get the source at specific version. Cloning the entire history shouldn't be necessary.

Resources

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions