Skip to content

Commit

Permalink
Switch base image from ubuntu to alpine (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
wetrocks committed Apr 5, 2023
1 parent 250ffe1 commit c2355b7
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions Dockerfile
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"]

0 comments on commit c2355b7

Please sign in to comment.