Skip to content

Update docker images to share scripts when possible #42201

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

Activity

  1. malbarbo commented on May 24, 2017

    @malbarbo
    ContributorAuthor
  2. added
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    E-help-wantedCall for participation: Help is requested to fix this issue.
    on May 24, 2017
  3. alexcrichton commented on May 24, 2017

    @alexcrichton
    Member

    Thanks for writing this up @malbarbo! If you're interested, want to write out some detailed steps for how to accomplish this? If we've got that listed we could likely list this as E-easy which would probably help get the work items here picked off very quickly!

  4. malbarbo commented on May 24, 2017

    @malbarbo
    ContributorAuthor

    @alexcrichton I wrote the steps. What do you think? Is it enough?

  5. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    on May 25, 2017
  6. alexcrichton commented on May 25, 2017

    @alexcrichton
    Member

    Looks great! If anyone's got any follow-up questions please feel free to ask here!

    @malbarbo I think there were some examples of this in a previous PR of yours as well, mind linking those here?

  7. malbarbo commented on May 25, 2017

    @malbarbo
    ContributorAuthor

    @alexcrichton I linked the android dockerfile updates.

  8. alexcrichton commented on May 25, 2017

    @alexcrichton
    Member
  9. added 2 commits that reference this issue on May 26, 2017
  10. added a commit that references this issue on May 28, 2017
  11. added a commit that references this issue on Jul 13, 2017
    06ffdeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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