freegeoip
freegeoip copied to clipboard
Resulting Docker image size ~800MB? Alpine?
Hello guys, that's a great idea for such service and thank you very much. But resulting docker image is > 800MB, just for an API that provides access to GeoLite2-City.mmdb.gz (±30mb) the additionnal 770MB sounds like too much.
You are using debian golang 1.9 image (>200mb) maybe switch to Alpine? This is only issue sofar.
If you rebuild the docker image of the apilayer/freegeoip the size IS 416M (as already noted) looks like you have the old image. (which works fine but doesn't use Alpine)
Not sure if the new built image has been put up for download yet, but easy enough to rebuild in Docker with the appropriate code.
But both Dockerfiles are starting with "FROM golang:1.9" how can they be different, just github paths changed.
i did docker build .
but it shows debian
/tmp/freegeoip(master)» docker build . [15:34:01]
Sending build context to Docker daemon 1.714MB
Step 1/7 : FROM golang:1.9
1.9: Pulling from library/golang
c73ab1c6897b: Pull complete
1ab373b3deae: Pull complete
b542772b4177: Pull complete
57c8de432dbe: Pull complete
c81227e1ec90: Pull complete
c503a785f6fd: Pull complete
0f90e5cd37cc: Pull complete
8e848f75f6b2: Pull complete
Digest: sha256:9f4178d47345fd1b9698eb9acc667d4df4ad45e91e8b797ba4b32f831d2b687d
Status: Downloaded newer image for golang:1.9
---> a6c306bd0b2f
Step 2/7 : COPY cmd/freegeoip/public /var/www
---> 01b381b586cb
Step 3/7 : ADD . /go/src/github.com/apilayer/freegeoip
---> a42832c3cf9d
Step 4/7 : RUN cd /go/src/github.com/apilayer/freegeoip/cmd/freegeoip && go get -d && go install && apt-get update && apt-get install -y libcap2-bin && setcap cap_net_bind_service=+ep /go/bin/freegeoip && apt-get clean && rm -rf /var/lib/apt/lists/* && useradd -ms /bin/bash freegeoip
---> Running in c236e62c6ed1
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:3 http://deb.debian.org/debian stretch Release [118 kB]
Get:4 http://security.debian.org stretch/updates InRelease [63.0 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2434 B]
Get:6 http://deb.debian.org/debian stretch-updates/main amd64 Packages [8431 B]
Get:7 http://deb.debian.org/debian stretch/main amd64 Packages [9530 kB]
Get:8 http://security.debian.org stretch/updates/main amd64 Packages [429 kB]
The #1 not merged yet..ok..waiting then