From b5fb248b464c2dd1e81a17c4d5508944844e6be1 Mon Sep 17 00:00:00 2001 From: Hemna Date: Thu, 17 Dec 2020 10:16:58 -0500 Subject: [PATCH] Updated the Dockerfile to use alpine The ubuntu images were running about 533MB in size, so I refactored the Dockerfiles to use alpine linux, and they run about 130MB. --- Dockerfile | 10 +++------- Dockerfile-dev | 20 ++++++++------------ 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7f1228..382d43f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 as aprsd +FROM alpine:latest as aprsd ENV VERSION=1.0.0 ENV APRS_USER=aprs @@ -6,11 +6,7 @@ ENV HOME=/home/aprs ENV VIRTUAL_ENV=$HOME/.venv3 ENV INSTALL=$HOME/install -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get -y update -RUN apt-get install -y wget gnupg git-core -RUN apt-get install -y apt-utils pkg-config sudo vim -RUN apt-get install -y python3 python3-pip python3-virtualenv python3-venv +RUN apk add --update git wget py3-pip py3-virtualenv bash # Setup Timezone ENV TZ=US/Eastern @@ -20,7 +16,7 @@ RUN dpkg-reconfigure --frontend noninteractive tzdata RUN addgroup --gid 1000 $APRS_USER -RUN useradd -m -u 1000 -g 1000 -p $APRS_USER $APRS_USER +RUN adduser -h $HOME -D -u 1001 -G $APRS_USER $APRS_USER ENV LC_ALL=C.UTF-8 ENV LANG=C.UTF-8 diff --git a/Dockerfile-dev b/Dockerfile-dev index ca64f44..9ea1682 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 as aprsd +FROM alpine:latest as aprsd # Dockerfile for building a container during aprsd development. @@ -10,21 +10,17 @@ ENV APRSD_BRANCH="master" ENV VIRTUAL_ENV=$HOME/.venv3 ENV INSTALL=$HOME/install -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get -y update -RUN apt-get install -y wget gnupg git-core -RUN apt-get install -y apt-utils pkg-config sudo vim -RUN apt-get install -y python3 python3-pip python3-virtualenv python3-venv +RUN apk add --update git vim wget py3-pip py3-virtualenv bash # Setup Timezone ENV TZ=US/Eastern -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN apt-get install -y tzdata -RUN dpkg-reconfigure --frontend noninteractive tzdata +#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +#RUN apt-get install -y tzdata +#RUN dpkg-reconfigure --frontend noninteractive tzdata - -RUN addgroup --gid 1000 $APRS_USER -RUN useradd -m -u 1000 -g 1000 -p $APRS_USER $APRS_USER +RUN addgroup --gid 1001 $APRS_USER +RUN adduser --help +RUN adduser -h $HOME -D -u 1001 -G $APRS_USER $APRS_USER ENV LC_ALL=C.UTF-8 ENV LANG=C.UTF-8