-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch base image from ubuntu to alpine (#12)
- Loading branch information
Showing
1 changed file
with
29 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,37 @@ | ||
FROM ubuntu:jammy | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive TZ="America\Los_Angeles" \ | ||
apt-get install -y \ | ||
build-essential \ | ||
bash \ | ||
git \ | ||
wget \ | ||
libzip-dev \ | ||
libssl-dev \ | ||
libcurl4-gnutls-dev \ | ||
libpugixml-dev \ | ||
&& apt-get autoclean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# RUN apt-get install -y valgrind | ||
|
||
RUN cd /usr/src \ | ||
&& git clone git://soutade.fr/libgourou.git \ | ||
# build apps | ||
FROM alpine:latest AS builder | ||
|
||
RUN apk add g++ \ | ||
pugixml-dev \ | ||
openssl-dev \ | ||
curl-dev \ | ||
libzip-dev \ | ||
make \ | ||
bash \ | ||
git | ||
|
||
WORKDIR /usr/src | ||
|
||
RUN git clone git://soutade.fr/libgourou.git \ | ||
&& cd libgourou \ | ||
&& make \ | ||
&& cp /usr/src/libgourou/libgourou.so /usr/local/lib \ | ||
&& cp /usr/src/libgourou/utils/acsmdownloader /usr/local/bin \ | ||
&& cp /usr/src/libgourou/utils/adept_activate /usr/local/bin \ | ||
&& cp /usr/src/libgourou/utils/adept_remove /usr/local/bin \ | ||
&& cd ~ \ | ||
&& rm -r /usr/src/libgourou \ | ||
&& ldconfig | ||
&& make BUILD_STATIC=1 | ||
|
||
|
||
RUN apt-get remove -y git build-essential \ | ||
&& apt-get clean | ||
# copy from builder to runtime image | ||
FROM alpine:latest | ||
|
||
RUN apk add --no-cache \ | ||
libcurl \ | ||
libzip \ | ||
pugixml \ | ||
bash | ||
|
||
COPY scripts /home/libgourou | ||
COPY --from=builder /usr/src/libgourou/utils/acsmdownloader \ | ||
/usr/src/libgourou/utils/adept_activate \ | ||
/usr/src/libgourou/utils/adept_remove \ | ||
/usr/local/bin/ | ||
|
||
WORKDIR /home/libgourou | ||
COPY scripts . | ||
|
||
ENTRYPOINT ["/bin/bash", "/home/libgourou/entrypoint.sh"] |