Skip to content

Update docker images to share scripts when possible #42201

Closed
@malbarbo

Description

@malbarbo

#41958 added the possibility of sharing scripts used in docker images. This allows, for example, to use the same script to install sccache in all images, consequently updating sccache can be done updating only one file.

We should update all images to share scripts when possible.

To update an image, one can follow these sequence of steps:

  • Choose an unchecked image in the below list;
  • Replace long RUN lines in the dockerfile of the image with scripts (like sccache.sh and dum-init.sh in src/ci/docker/scripts/, see for example the updates of arm-android and dist-android). You can organize the dockerfile in sections to make it easy to follow. sccache should be installed last. This avoids the whole container rebuild when sscache is updated;
  • See if files in COPY lines are duplicated in other images (duplicated files can be found using the command fdupes -r src/ci/). If there are duplicated files, move then to src/ci/docker/scripts/ and update the docker files;
  • Test with the command src/ci/docker/run.sh image with the modified image still works (docker is required).

List of images (unchecked images need to be updated):

  • arm-android
  • armhf-gnu
  • cross
  • dist-aarch64-linux
  • dist-android
  • dist-armhf-linux
  • dist-arm-linux
  • dist-armv7-linux
  • dist-fuchsia
  • dist-i586-gnu-i686-musl
  • dist-i686-freebsd
  • dist-i686-linux
  • dist-mips64el-linux
  • dist-mips64-linux
  • dist-mipsel-linux
  • dist-mips-linux
  • dist-powerpc64le-linux
  • dist-powerpc64-linux
  • dist-powerpc-linux
  • dist-s390x-linux
  • dist-x86_64-freebsd
  • dist-x86_64-linux
  • dist-x86_64-musl
  • dist-x86_64-netbsd
  • emscripten
  • i686-gnu
  • i686-gnu-nopt
  • x86_64-gnu
  • x86_64-gnu-aux
  • x86_64-gnu-debug
  • x86_64-gnu-distcheck
  • x86_64-gnu-full-bootstrap
  • x86_64-gnu-incremental
  • x86_64-gnu-llvm-3.7
  • x86_64-gnu-nopt

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions