[igt-dev] [PATCH i-g-t 1/8] Dockerfile: Avoid messing with WORKDIR

Petri Latvala petri.latvala at intel.com
Tue Sep 3 09:35:10 UTC 2019


On Tue, Sep 03, 2019 at 11:36:07AM +0300, Arkadiusz Hiler wrote:
> Just to reset it soon after. Let's just `cd` for each command.
> 
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
> ---
>  Dockerfile.build-fedora | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/Dockerfile.build-fedora b/Dockerfile.build-fedora
> index 4ccaadd1..31056a2a 100644
> --- a/Dockerfile.build-fedora
> +++ b/Dockerfile.build-fedora
> @@ -27,11 +27,11 @@ RUN dnf install -y \
>  # We need peg to build overlay
>  RUN dnf install -y make
>  RUN mkdir /tmp/peg
> -WORKDIR /tmp/peg
> +
>  # originaly from http://piumarta.com/software/peg/
> -RUN curl -O https://intel-gfx-ci.01.org/mirror/peg/peg-0.1.18.tar.gz
> -RUN tar xf peg-0.1.18.tar.gz
> -RUN cd peg-0.1.18 && make PREFIX=/usr install
> +RUN cd /tmp/peg && curl -O https://intel-gfx-ci.01.org/mirror/peg/peg-0.1.18.tar.gz
> +RUN tar -C /tmp/peg -xf /tmp/peg/peg-0.1.18.tar.gz
> +RUN cd /tmp/peg/peg-0.1.18 && make PREFIX=/usr install

make -C /tmp/peg/peg-0.1.18 PREFIX=/usr install

>  RUN rm -fr /tmp/peg
>  
>  # For compile-testing on clang
> @@ -41,8 +41,4 @@ RUN dnf install -y clang
>  RUN dnf install -y findutils
>  
>  # Meson version switching shenanigans
> -WORKDIR /usr/src
> -RUN curl -O https://files.pythonhosted.org/packages/c0/9b/44cdb8adcbb186be6cba5c93718d0c68f177b0e8082ae00cafa63a1d3535/meson-0.47.0.tar.gz
> -
> -# Cleanup workdir
> -WORKDIR /
> +RUN cd /usr/src && curl -O https://files.pythonhosted.org/packages/c0/9b/44cdb8adcbb186be6cba5c93718d0c68f177b0e8082ae00cafa63a1d3535/meson-0.47.0.tar.gz

Removing the useless-use-of-cd in this curl invocation:

curl -o "/usr/src/#1" "https://files.pythonhosted.org/packages/c0/9b/44cdb8adcbb186be6cba5c93718d0c68f177b0e8082ae00cafa63a1d3535/{meson-0.47.0.tar.gz}"


Similar trick can be applied to the above curl line.


-- 
Petri Latvala


More information about the igt-dev mailing list