Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion alpine-fat/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# https://github.com/openresty/docker-openresty
#
# This is an alpine-based build that keeps some build-related
# packages, has perl installed for opm, and includes luarocks.
# packages, has perl installed for opm, Test::Nginx for testing,
# and includes luarocks.

FROM alpine:latest

Expand Down Expand Up @@ -61,6 +62,7 @@ RUN apk add --no-cache --virtual .build-deps \
geoip-dev \
libxslt-dev \
perl-dev \
perl-utils \
readline-dev \
zlib-dev \
&& apk add --no-cache \
Expand Down Expand Up @@ -104,6 +106,7 @@ RUN apk add --no-cache --virtual .build-deps \
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \
&& make build \
&& make install \
&& PERL_MM_USE_DEFAULT=1 cpan install Test::Nginx \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neomantra I made these changes. Surprisingly, it bumped the image size up from 255 MB to 291 MB. If we're comfortable with that then I can squash as is. I do think the curl approach is perfectly valid, and does avoid having to install cpan.

Copy link
Member

@neomantra neomantra Nov 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... I think there might be cpan cache's that need to get deleted too -- /root/.cpan is taking 55.6M. So after removing cpanminus, there needs to be this line:
&& rm -rf /root/.cpan /tmp/cpan* \

That was a quick glance using find . -name '*cpan*' within the image.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, i see you aren't using cpanminus... just put that after the install.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gah, sorry again... I think it should just be the build folder? /root/.cpan/build or perhaps there's a way to tell cpan not to save stuff. The build folder is ~18MB.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @neomantra, I'll give this a try. I'm busy all day today but I'll pick this up again in a couple days.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neomantra You were spot on. Removing the /root/.cpan directory got the image down to 241 MB. Versus the current image that's 234 MB.

&& cd /tmp \
&& rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \
&& apk add --no-cache --virtual .gettext gettext \
Expand Down