Skip to content

Commit 52954e0

Browse files
committed
Merge pull request #3664 from aledbf/alpinelinux
ref(*): use alpine as replacement of ubuntu-debootstrap as base image
2 parents 7936b36 + ee9fa23 commit 52954e0

2 files changed

Lines changed: 22 additions & 16 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM ubuntu-debootstrap:14.04
1+
FROM alpine:3.1
22

33
ENV DEBIAN_FRONTEND noninteractive
44

55
# install common packages
6-
RUN apt-get update && apt-get install -y curl net-tools sudo
6+
RUN apk add --update-cache curl bash sudo && rm -rf /var/cache/apk/*
77

88
# install etcdctl
99
RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/opdemand/etcdctl-v0.4.6 \

build.sh

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,24 @@ if [[ -z $DOCKER_BUILD ]]; then
1010
exit 1
1111
fi
1212

13-
DEBIAN_FRONTEND=noninteractive
14-
1513
# install required system packages
1614
# HACK: install git so we can install bacongobbler's fork of django-fsm
17-
# install openssh-client for temporary fleetctl wrapper
18-
apt-get update && \
19-
apt-get install -yq python-dev libffi-dev libpq-dev libyaml-dev git libldap2-dev libsasl2-dev
15+
apk add --update-cache \
16+
build-base \
17+
git \
18+
libffi-dev \
19+
libpq \
20+
openldap \
21+
openldap-dev \
22+
postgresql-dev \
23+
python \
24+
python-dev
2025

2126
# install pip
2227
curl -sSL https://raw.githubusercontent.com/pypa/pip/6.1.1/contrib/get-pip.py | python -
2328

2429
# add a deis user
25-
useradd deis --home-dir /app --shell /bin/bash
30+
adduser deis -D -h /app -s /bin/bash
2631

2732
# create a /app directory for storing application data
2833
mkdir -p /app && chown -R deis:deis /app
@@ -33,11 +38,12 @@ mkdir -p /templates && chown -R deis:deis /templates
3338
# install dependencies
3439
pip install -r /app/requirements.txt
3540

36-
# cleanup. indicate that python, libpq and libyanl are required packages.
37-
apt-mark unmarkauto python python-openssl libpq5 libpython2.7 libffi6 libyaml-0-2 && \
38-
apt-get remove -y --purge python-dev gcc cpp libffi-dev libpq-dev libyaml-dev git && \
39-
apt-get autoremove -y --purge && \
40-
apt-get clean -y && \
41-
rm -Rf /usr/share/man /usr/share/doc && \
42-
rm -rf /tmp/* /var/tmp/* && \
43-
rm -rf /var/lib/apt/lists/*
41+
# cleanup.
42+
apk del --purge \
43+
build-base \
44+
git \
45+
libffi-dev \
46+
openldap-dev \
47+
postgresql-dev \
48+
python-dev
49+
rm -rf /var/cache/apk/*

0 commit comments

Comments
 (0)