Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update setup-container.sh to save build time. (#6541)
Description of PR In setup-container.sh, when building the docker container, the step "User configuration" will hang around several minutes probability because of the bug [moby/moby#5419] of docker, and the whole script will cost about 20 minutes. Using useradd can work around this bug, but usermod can't. In this pr, we use useradd instead of usermod to work around this bug, and save the build time. Now, the whole script will take around 6 minutes. What is the motivation for this PR? In setup-container.sh, when building the docker container, the step "User configuration" will hang around several minutes probability because of the bug [moby/moby#5419] of docker, and the whole script will cost about 20 minutes. Using useradd can work around this bug, but usermod can't. In this pr, we use useradd instead of usermod to work around this bug, and save the build time. Now, the whole script will take around 6 minutes. How did you do it? In step "User configuration", when getent passwd {{ USER_NAME }} returns True, first delete the user and use useradd to add the user. How did you verify/test it? Setup container with new script and run test cases. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
- Loading branch information