@@ -11,6 +11,7 @@ pipeline {
1111 booleanParam(name : ' unit_validate' , defaultValue : true , description : ' amd64 (x86_64) unit tests and vendor check' )
1212 booleanParam(name : ' validate_force' , defaultValue : false , description : ' force validation steps to be run, even if no changes were detected' )
1313 booleanParam(name : ' amd64' , defaultValue : true , description : ' amd64 (x86_64) Build/Test' )
14+ booleanParam(name : ' rootless' , defaultValue : true , description : ' amd64 (x86_64) Build/Test (Rootless mode)' )
1415 booleanParam(name : ' arm64' , defaultValue : true , description : ' ARM (arm64) Build/Test' )
1516 booleanParam(name : ' s390x' , defaultValue : true , description : ' IBM Z (s390x) Build/Test' )
1617 booleanParam(name : ' ppc64le' , defaultValue : true , description : ' PowerPC (ppc64le) Build/Test' )
@@ -380,6 +381,94 @@ pipeline {
380381 }
381382 }
382383 }
384+ stage(' rootless' ) {
385+ when {
386+ beforeAgent true
387+ expression { params. rootless }
388+ }
389+ agent { label ' amd64 && ubuntu-1804 && overlay2' }
390+ stages {
391+ stage(" Print info" ) {
392+ steps {
393+ sh ' docker version'
394+ sh ' docker info'
395+ sh '''
396+ echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
397+ curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
398+ && bash ${WORKSPACE}/check-config.sh || true
399+ '''
400+ }
401+ }
402+ stage(" Build dev image" ) {
403+ steps {
404+ sh '''
405+ docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .
406+ '''
407+ }
408+ }
409+ stage(" Integration tests" ) {
410+ environment {
411+ DOCKER_EXPERIMENTAL = ' 1'
412+ DOCKER_ROOTLESS = ' 1'
413+ TEST_SKIP_INTEGRATION_CLI = ' 1'
414+ }
415+ steps {
416+ sh '''
417+ docker run --rm -t --privileged \
418+ -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
419+ --name docker-pr$BUILD_NUMBER \
420+ -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
421+ -e DOCKER_GRAPHDRIVER \
422+ -e DOCKER_EXPERIMENTAL \
423+ -e DOCKER_ROOTLESS \
424+ -e TEST_SKIP_INTEGRATION_CLI \
425+ -e TIMEOUT \
426+ -e VALIDATE_REPO=${GIT_URL} \
427+ -e VALIDATE_BRANCH=${CHANGE_TARGET} \
428+ docker:${GIT_COMMIT} \
429+ hack/make.sh \
430+ dynbinary \
431+ test-integration
432+ '''
433+ }
434+ post {
435+ always {
436+ junit testResults : ' bundles/**/*-report.xml' , allowEmptyResults : true
437+ }
438+ }
439+ }
440+ }
441+
442+ post {
443+ always {
444+ sh '''
445+ echo "Ensuring container killed."
446+ docker rm -vf docker-pr$BUILD_NUMBER || true
447+ '''
448+
449+ sh '''
450+ echo "Chowning /workspace to jenkins user"
451+ docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
452+ '''
453+
454+ catchError(buildResult : ' SUCCESS' , stageResult : ' FAILURE' , message : ' Failed to create bundles.tar.gz' ) {
455+ sh '''
456+ bundleName=amd64-rootless
457+ echo "Creating ${bundleName}-bundles.tar.gz"
458+ # exclude overlay2 directories
459+ find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
460+ '''
461+
462+ archiveArtifacts artifacts : ' *-bundles.tar.gz' , allowEmptyArchive : true
463+ }
464+ }
465+ cleanup {
466+ sh ' make clean'
467+ deleteDir()
468+ }
469+ }
470+ }
471+
383472 stage(' s390x' ) {
384473 when {
385474 beforeAgent true
0 commit comments