Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Condense docker container #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 6 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@
FROM ubuntu:21.04
FROM alpine:3.15.0 AS build

RUN apt-get update && \
apt-get -y install curl gcc make zlib1g-dev && \
apt-get -y clean && \
rm -rf \
/var/lib/apt/lists/* \
/usr/share/doc \
/usr/share/doc-base \
/usr/share/man \
/usr/share/locale \
/usr/share/zoneinfo
RUN apk add build-base curl zlib-dev
WORKDIR /root
RUN curl -o nauty27r3.tar.gz http://users.cecs.anu.edu.au/~bdm/nauty/nauty27r3.tar.gz \
&& tar xzvf nauty27r3.tar.gz \
&& cd nauty27r3 \
&& ./configure && make
&& ./configure && make -j4
ENV NAUTY_HOME=/root/nauty27r3
COPY src/surge.c $NAUTY_HOME
COPY src/Makefile /root
WORKDIR $NAUTY_HOME
RUN ln -s /root/nauty27r3 /root/nauty
RUN make -f ../Makefile clean ; make -f ../Makefile surge

FROM ubuntu:21.04

RUN apt-get update && \
apt-get -y install curl time gnupg zlib1g && \
apt-get -y clean && \
rm -rf \
/var/lib/apt/lists/* \
/usr/share/doc \
/usr/share/doc-base \
/usr/share/man \
/usr/share/locale \
/usr/share/zoneinfo
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && apt-get update -y && apt-get install google-cloud-sdk -y

COPY --from=0 /root/nauty27r3/surge /usr/bin
FROM alpine:3.15.0
RUN apk add zlib
COPY --from=build /root/nauty27r3/surge /usr/bin