Now uses slim image (#552)

This commit is contained in:
Nikita Sobolev 2021-09-18 19:17:44 +03:00 committed by GitHub
parent 6712fe0689
commit b290d3e040
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,13 @@
# Stage 1 # Stage 1
# Builds the Livebook release # Builds the Livebook release
FROM hexpm/elixir:1.12.0-erlang-24.0-alpine-3.13.3 AS build FROM hexpm/elixir:1.12.3-erlang-24.0.6-debian-buster-20210902-slim AS build
RUN apk add --no-cache build-base git RUN apt-get update && apt-get upgrade -y && \
apt-get install --no-install-recommends -y \
build-essential git && \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app
@ -32,13 +37,17 @@ RUN mix do compile, release
# We use the same base image, because we need Erlang, Elixir and Mix # We use the same base image, because we need Erlang, Elixir and Mix
# during runtime to spawn the Livebook standalone runtimes. # during runtime to spawn the Livebook standalone runtimes.
# Consequently the release doesn't include ERTS as we have it anyway. # Consequently the release doesn't include ERTS as we have it anyway.
FROM hexpm/elixir:1.12.0-erlang-24.0-alpine-3.13.3 FROM hexpm/elixir:1.12.3-erlang-24.0.6-debian-buster-20210902-slim
RUN apk add --no-cache \ RUN apt-get update && apt-get upgrade -y && \
# Runtime dependencies apt-get install --no-install-recommends -y \
openssl ncurses-libs \ # Runtime dependencies
# In case someone uses `Mix.install/2` and point to a git repo build-essential ca-certificates libncurses5-dev \
git # In case someone uses `Mix.install/2` and point to a git repo
git && \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# Run in the /data directory by default, makes for # Run in the /data directory by default, makes for
# a good place for the user to mount local volume # a good place for the user to mount local volume