From e745fb075472fe3f58f42b16efb0b38516963657 Mon Sep 17 00:00:00 2001 From: Phileas Lebada Date: Mon, 22 Feb 2021 14:02:33 +0100 Subject: [PATCH] Fix builds for kaniko-users https://github.com/GoogleContainerTools/kaniko/issues/1246 --- Dockerfile-alpine.template | 15 +++++++-------- Dockerfile-debian.template | 12 ++++++------ Dockerfile-slim.template | 10 +++++----- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 54f011fb1..e742b6ca0 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -6,12 +6,11 @@ RUN apk add --no-cache \ gmp-dev # skip installing gem documentation -RUN set -eux; \ - mkdir -p /usr/local/etc; \ - { \ - echo 'install: --no-document'; \ - echo 'update: --no-document'; \ - } >> /usr/local/etc/gemrc +RUN mkdir -p /usr/local/etc; \ + printf '%s\n' \ + 'install: --no-document' \ + 'update: --no-document' \ + >> /usr/local/etc/gemrc ENV LANG C.UTF-8 ENV RUBY_MAJOR %%VERSION%% @@ -71,11 +70,11 @@ RUN apk add --no-cache --virtual .ruby-builddeps \ \ # hack in "ENABLE_PATH_CHECK" disabling to suppress: # warning: Insecure world writable dir - { \ + ( \ echo '#define ENABLE_PATH_CHECK 0'; \ echo; \ cat file.c; \ - } > file.c.new; \ + ) > file.c.new; \ mv file.c.new file.c; \ \ autoconf; \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index df106cb5b..2b7e39fa5 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -4,10 +4,10 @@ SHELL ["/bin/bash", "-eux", "-c"] # skip installing gem documentation RUN mkdir -p /usr/local/etc; \ - { \ - echo 'install: --no-document'; \ - echo 'update: --no-document'; \ - } >> /usr/local/etc/gemrc + printf '%s\n' \ + 'install: --no-document' \ + 'update: --no-document' \ + >> /usr/local/etc/gemrc ENV LANG C.UTF-8 ENV RUBY_MAJOR %%VERSION%% @@ -38,11 +38,11 @@ RUN savedAptMark="$(apt-mark showmanual)"; \ \ # hack in "ENABLE_PATH_CHECK" disabling to suppress: # warning: Insecure world writable dir - { \ + ( \ echo '#define ENABLE_PATH_CHECK 0'; \ echo; \ cat file.c; \ - } > file.c.new; \ + ) > file.c.new; \ mv file.c.new file.c; \ \ autoconf; \ diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index 734cace3c..145e663c5 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -17,10 +17,10 @@ RUN apt-get update; \ # skip installing gem documentation RUN mkdir -p /usr/local/etc; \ - { \ - echo 'install: --no-document'; \ - echo 'update: --no-document'; \ - } >> /usr/local/etc/gemrc + printf '%s\n' \ + 'install: --no-document' \ + 'update: --no-document' \ + >> /usr/local/etc/gemrc ENV LANG C.UTF-8 ENV RUBY_MAJOR %%VERSION%% @@ -98,7 +98,7 @@ RUN savedAptMark="$(apt-mark showmanual)"; \ # make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \ gem update --system "$RUBYGEMS_VERSION"; \ - rm -r /root/.gem/; \ + rm -fr /root/.gem/; \ # verify we have no "ruby" packages installed if dpkg -l | grep -i 'ruby'; then false; fi; \ [ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \