diff --git a/content/08_dockerfiles.md b/content/08_dockerfiles.md index 733c873a9f14dab27489f8602843c51acd547d25..b6262f442a3fbc81ab3a413341e8493f4123270e 100644 --- a/content/08_dockerfiles.md +++ b/content/08_dockerfiles.md @@ -246,3 +246,34 @@ ENTRYPOINT ["./alienwave"] REPOSITORY TAG IMAGE ID CREATED SIZE alienware 1.0 f4ee2cb8bbb4 46 seconds ago 340MB ``` + +### Partie 2 + +- Quel est le nom de la dernière image `alpine` ? + - `alpine:3.20` + + +#### Dockerfile + +```bash +FROM ubuntu:22.04 as BUILDER + +RUN apt update -y && apt install libncurses-dev wget -y +RUN apt install -y build-essential +RUN wget https://www.alessandropira.org/alienwave/alienwave-0.4.0.tar.gz +RUN tar -xzf alienwave-0.4.0.tar.gz +RUN cd alienwave/ && sed -i 's/LIB = -lncurses/LIB = -lncurses -ltinfo -static/g' Makefile && make + +FROM alpine:3.20 +RUN apk update && apk add ncurses +COPY --from=builder /alienwave/alienwave /usr/bin + +ENTRYPOINT ["/usr/bin/alienwave"] +``` + +- On a réussi à atteindre une taille de 12MB. + +```bash +REPOSITORY TAG IMAGE ID CREATED SIZE +alienware_multistage 1.0 1c7f0a242c2c 4 minutes ago 12MB +```