Skip to content

Commit 3fc4a6e

Browse files
committed
Dockerfile layering clean ups
Merging RUN commands where possible, and use WORKDIR instead of "cd"
1 parent 962bf61 commit 3fc4a6e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Dockerfile

+8-6
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ RUN apt-get update -y \
1919
unzip wget zip \
2020
# Clean up to reduce docker image size
2121
&& apt-get clean \
22-
&& rm -rf /var/lib/apt/lists/*
22+
&& rm -rf /var/lib/apt/lists/* \
23+
# Make sure the directory we'll mount and reference is there
24+
&& mkdir -p /data
2325

24-
RUN mkdir -p /data
25-
WORKDIR /data
2626
USER nonroot
27+
WORKDIR /data
2728
COPY actions-services.yml /data
2829
COPY composer-install.sh /data
2930
COPY composer.json /data
@@ -38,7 +39,8 @@ COPY .travis.yml /data
3839
COPY SilMock/ /data/SilMock
3940

4041
USER root
41-
RUN cd /data && ./composer-install.sh
42-
RUN mv /data/composer.phar /usr/bin/composer
43-
RUN /usr/bin/composer install
42+
WORKDIR /data
43+
RUN ./composer-install.sh \
44+
&& mv /data/composer.phar /usr/bin/composer \
45+
&& /usr/bin/composer install
4446
USER nonroot

0 commit comments

Comments
 (0)