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

multistage build added #532

Open
wants to merge 1 commit into
base: develop
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
20 changes: 18 additions & 2 deletions esim-cloud-backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM python:3.7-alpine3.13
# Builder stage 1: NGSpice and Compiling tools
FROM python:3.7-alpine3.13 as builder

ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
Expand Down Expand Up @@ -31,7 +32,11 @@ RUN curl -fSL https://github.com/imr/ngspice/archive/ngspice-$NGSPICE_VERSION.ta
&& make install \
&& apk del .build-deps

# Arduino Cli and Compiling tools
# Builder stage 2: Arduino CLI and Compiling tools
FROM python:3.7-alpine3.13 as arduino_builder

ENV USER=root

RUN apk add \
wget \
tar \
Expand Down Expand Up @@ -61,8 +66,19 @@ RUN arduino-cli core update-index \
&& find . -name ctags -exec ln -nsf /usr/bin/ctags {} \;


# Final stage
FROM python:3.7-alpine3.13

ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1

RUN apk add --no-cache libxt jpeg-dev zlib-dev libxaw-dev libx11-dev libtool mariadb-connector-c-dev libffi-dev postgresql-dev

COPY --from=builder /usr/local /usr/local
COPY --from=arduino_builder /usr/bin/arduino-cli /usr/bin/arduino-cli

WORKDIR /code

COPY requirements.txt /code/
RUN apk add --no-cache mariadb-connector-c-dev ;\
apk add --update alpine-sdk && \
Expand Down
Loading