Comments (11)
I think this is worth investigating more
You might get away with adding this as runtime dependency http://pkgs.alpinelinux.org/package/v3.4/main/armhf/libgcc and not the whole gcc
after this change, the image is 165M size and that defeats the purpose of using alpine as base
openresty/openresty alpine 3b4c539c6ec2 32 hours ago 165.6 MB
looking into it, i'll post back if this works
from docker-openresty.
I am actually in progress with exactly that (using libgcc
), after thinking about our other issue/conversation ;)
from docker-openresty.
If you are interested in following along:
diff --git a/alpine/Dockerfile b/alpine/Dockerfile
index 2a110b0..1036f52 100644
--- a/alpine/Dockerfile
+++ b/alpine/Dockerfile
@@ -55,21 +55,21 @@ RUN \
apk add --no-cache --virtual .build-deps \
build-base \
curl \
+ gcc \
gd-dev \
geoip-dev \
libxslt-dev \
linux-headers \
make \
perl-dev \
+ readline \
zlib-dev \
&& apk add --no-cache \
- gcc \
gd \
geoip \
+ libgcc \
libxslt \
ncurses \
- perl \
- readline \
zlib \
&& cd /tmp \
&& curl -fSL https://www.openssl.org/source/openssl-${RESTY_OPENSSL_VERSION}.tar.gz -o openssl-${RESTY_OPENSSL_VERSION}.tar.gz \
from docker-openresty.
I can confirm using libgcc instead of gcc works.
I checked it like this:
- compiled with libgcc instead of gcc
- checked the image size (87M)
- inside the container i executed
/usr/local/openresty/bin/resty -e "ngx.say('hello')"
and it worked - removed the lib like this
mv /usr/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1.temp
and checked step 3 again, and it generated the reported error
long story short, change this line https://github.com/openresty/docker-openresty/blob/master/alpine/Dockerfile#L66
from gcc \
to libgcc \
PS: it's worth investigating a bit where these 87M come from
alpine is about 5M
/usr/local/openresty after the build is 32.4M
so there are an additional ~40M that might not be really needed
from docker-openresty.
you don't need gcc in .build-deps, it compiles without it
from docker-openresty.
curious as to why you chose to add --with-http_perl_module=dynamic
since the point of openresty is to use lua. Will anybody be using perl with this image?
from docker-openresty.
removing perl get's us to
openresty latest f2e26742a6bb 37 seconds ago 45.96 MB
It's worth looking at this image https://github.com/ficusio/openresty/blob/master/alpine/Dockerfile since it's size 13M and see why this official image is so big
from docker-openresty.
So you are right on a few fronts...
libgcc
can be used instead ofgcc
as a runtime dependgcc
is included inbuild-base
so adding it is redundant- why include the perl module (I was following an amalgamation of various nginx guides)
I'll wait a bit to see if you have more comments, but otherwise I'll commit these changes.
Thanks for looking into this.
from docker-openresty.
looks like the docs are a bit old, downloading that image shows this
ficusio/openresty latest 849eac5fefd4 4 months ago 35.03 MB
from docker-openresty.
I have not discovered any other 'pearls' so i guess you should commit this and get the image to 80M.
The next step would be to decide on perl/resty issue.
PS: I realise that i't mostly "a thing in my head" but it bugs me a bit that the OS is 5M and this image is 80M :). For now, 80M is good enough for me to go on with my project and if along the way i find some other optimisations, i'll post back.
Thank you
from docker-openresty.
I just pushed that gcc changeset and it should be on Docker Hub in a bit.
from docker-openresty.
Related Issues (20)
- Point for command injection after openresty download before configure HOT 7
- Cannot able to install luaexpat on top of openresty-centos8 HOT 4
- modsecurity-crs-docker integration HOT 18
- Openresty cannot able to resolve DNS changes HOT 1
- 你的微信号多少,发我邮箱
- ngx_http_upstream_check_module无法添加模块 HOT 1
- fedora aarch64 builds failing HOT 1
- Add Debian 12 `bookworm` release HOT 7
- Upgrade OpenSSL to 1.1.1u HOT 3
- image for new release v1.21.4.2 HOT 7
- Upgrade to openssl 3.0 HOT 1
- HTTP2 Rapid Reset Mitigation HOT 3
- Can't load the cjson module into luajit CLI HOT 1
- Update debian and other images HOT 1
- Builds for Debian 11 and 12 are broken HOT 2
- Image for new release 1.25.3.1 HOT 3
- Adding Third Party Modules to Debian Images Utilizing the ".deb" Installation
- OpenSSL 1.1.1x for CVE-2023-5678 HOT 1
- environment variable injected by docker compose is not available in openresty process HOT 2
- RHEL support for openresty HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-openresty.