Skip to content

Commit

Permalink
Put obs-docker-support uninstall before the last user line
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Jun 14, 2018
1 parent e01a206 commit c2f20ee
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build-recipe-docker
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,16 @@ recipe_build_docker() {
done

# patch in obs-docker-support helper
sed -i '/^[ ]*[fF][rR][oO][mM]/a COPY .obs-docker-support /usr/local/sbin/obs-docker-support\nRUN obs-docker-support --install' $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE
sed -i '/^[ ]*[fF][rR][oO][mM]/a COPY .obs-docker-support /usr/local/sbin/obs-docker-support\nRUN obs-docker-support --install' "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE"
echo >> $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE
echo 'RUN obs-docker-support --uninstall' >> $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE
test -n "$DISTURL" && echo "LABEL DISTURL=$DISTURL" >> $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE
if test -n "$(sed -ne '/^[ ]*[uU][sS][eE][rR][ ]/p' "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE")" ; then
sed -i '1,/^[ ]*[uU][sS][eE][rR][ ]/{
/^[ ]*[uU][sS][eE][rR][ ]/i RUN obs-docker-support --uninstall
}' "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE"
else
echo 'RUN obs-docker-support --uninstall' >> "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE"
fi
test -n "$DISTURL" && echo "LABEL DISTURL=$DISTURL" >> "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE"

# now do the build
echo "Building image $ALLTAGS"
Expand Down

0 comments on commit c2f20ee

Please sign in to comment.