From ce5a681a4eb8e1354c418e152adf874f490125bc Mon Sep 17 00:00:00 2001 From: Sammy Pfeiffer Date: Sun, 8 Mar 2020 15:20:05 +1100 Subject: [PATCH 1/3] Little hack to earn extra disk space... we are very short on it --- Dockerfile.package | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile.package b/Dockerfile.package index 019299a..4d80c2e 100644 --- a/Dockerfile.package +++ b/Dockerfile.package @@ -6,6 +6,11 @@ RUN df -h RUN rm -rf $EPREFIX/var/cache/binpkgs/* $EPREFIX/var/tmp/* /home/nao/.cache/* RUN emerge app-portage/gentoolkit RUN eclean -d distfiles +# Hack to earn extra 500MB~ +USER root +RUN rm -rf /opt +USER nao + RUN df -h # If we don't do --remove-files we may not have enough disk space # I was getting: tar: gentoo/opt/ros/kinetic/lib/pkgconfig: file changed as we read it and tar returned 1 From 9ddc569cc4414b3934b8936d5e0fb7b85e4b2e1e Mon Sep 17 00:00:00 2001 From: Sammy Pfeiffer Date: Sun, 8 Mar 2020 15:51:06 +1100 Subject: [PATCH 2/3] Do docker login later, so on PRs we can execute the interesting contributions --- azure-pipelines.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 356eac5..57b7eeb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,13 +9,12 @@ jobs: docker_image_name: pepper_os_image steps: - - script: docker login -u $(DockerHub_user) -p $(DockerHub_password) - displayName: 'docker login' - # We divide the boostrap in 3 parts to not go over the 6h limit as gcc takes ages - script: docker build --network host -f Dockerfile -t $(DockerHub_user)/$(docker_image_name):$(Build.BuildId) . displayName: 'docker build' # This means up to 6h timeoutInMinutes: 0 + - script: docker login -u $(DockerHub_user) -p $(DockerHub_password) + displayName: 'docker login' # Even if it fails I want to push the image to DockerHub for inspection # The variables are set on the Build options on the web interface # # Try to tag the latest failed image we ran @@ -50,14 +49,13 @@ jobs: rosdistro: ros-kinetic steps: - # The variables are set on the Build options on the web interface - - script: docker login -u $(DockerHub_user) -p $(DockerHub_password) - displayName: 'docker login' - - script: docker build -f Dockerfile.package -t $(DockerHub_user)/$(docker_image_name):$(Build.BuildId) . displayName: 'docker build package_stage' # This means up to 6h timeoutInMinutes: 0 + # The variables are set on the Build options on the web interface + - script: docker login -u $(DockerHub_user) -p $(DockerHub_password) + displayName: 'docker login' # Even if it fails I want to push the image to DockerHub for inspection - script: docker tag `docker ps -a -l -q | xargs docker commit | awk -F":" '{print $2}'` $(DockerHub_user)/$(docker_image_name):$(Build.BuildId) displayName: 'create image to push to DockerHub' From 1f81013da8f85ba3deb44313baba609fa681b1fc Mon Sep 17 00:00:00 2001 From: Sammy Pfeiffer Date: Sun, 8 Mar 2020 19:23:01 +1100 Subject: [PATCH 3/3] Fix to be able to rm /opt --- Dockerfile.package | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile.package b/Dockerfile.package index 4d80c2e..b0e5e6e 100644 --- a/Dockerfile.package +++ b/Dockerfile.package @@ -7,9 +7,12 @@ RUN rm -rf $EPREFIX/var/cache/binpkgs/* $EPREFIX/var/tmp/* /home/nao/.cache/* RUN emerge app-portage/gentoolkit RUN eclean -d distfiles # Hack to earn extra 500MB~ +SHELL ["/bin/bash"] USER root RUN rm -rf /opt USER nao +SHELL ["/tmp/gentoo/executeonprefix"] + RUN df -h # If we don't do --remove-files we may not have enough disk space