Skip to content

Commit 050f29c

Browse files
pataquetsitamarhaber
authored andcommitted
Dockerfile optimizations (#70)
* Optimize final image build size by grouping commands in the same build step and deleting unneeded package installation files. Add non-interactive env vars. * Add non-interactive env vars to builder apt-get. Readability. * apt-get switches: be less forceful to allow detection of potentially harmful build errors. * Add '--no-install-recommends' switch to apt-get command to reduce build time and make image smaller (#70).
1 parent a4ce621 commit 050f29c

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
FROM ubuntu:16.04 as builder
22
RUN apt-get update
3-
RUN apt-get install -yy build-essential autoconf automake libpcre3-dev libevent-dev pkg-config zlib1g-dev git libboost-all-dev cmake flex
3+
RUN \
4+
DEBIAN_FRONTEND=noninteractive \
5+
apt-get install -y \
6+
build-essential autoconf automake libpcre3-dev libevent-dev \
7+
pkg-config zlib1g-dev git libboost-all-dev cmake flex
48
RUN git clone https://github.com/RedisLabs/memtier_benchmark.git
59
WORKDIR /memtier_benchmark
610
RUN autoreconf -ivf && ./configure && make && make install
711

812
FROM ubuntu:16.04
913
LABEL Description="memtier_benchmark"
1014
COPY --from=builder /usr/local/bin/memtier_benchmark /usr/local/bin/memtier_benchmark
11-
RUN apt-get update
12-
RUN apt-get install -yy libevent-dev
15+
RUN \
16+
apt-get update && \
17+
DEBIAN_FRONTEND=noninteractive \
18+
apt-get install -y --no-install-recommends \
19+
libevent-dev \
20+
&& \
21+
apt-get clean && \
22+
rm -rf /var/lib/apt/lists/
23+
1324
ENTRYPOINT ["memtier_benchmark"]

0 commit comments

Comments
 (0)