Permalink
Browse files

Switch to alpine as base docker image.

  • Loading branch information...
vlad-alexandru-ionescu committed Apr 21, 2016
1 parent 4105662 commit ef01a2396e176f7af34cad2475989f90ff5346f3
View
@@ -202,8 +202,9 @@ docker-images: $(DOCKER_TARGETS)
docker-%: $(SERVICES_DIR)/%/Dockerfile FORCE
$(DOCKER) build -t leveros/$(@:docker-%=%) $(dir $<)
-docker-consul: | docker-ubuntubase
-docker-leveroshost: | docker-ubuntubase
+docker-consul: | docker-base
+docker-leveroshost: | docker-base
+docker-levercontainer: | docker-base
docker-leveroshost: $(SERVICES_DIR)/leveroshost/leveroshost
$(SERVICES_DIR)/leveroshost/leveroshost: $(BIN_DIR)/leveroshost
cp $< $@
View
@@ -8,5 +8,5 @@ docker run --rm --entrypoint "${entry_point}" \
-v "${PWD}/${1}:${entry_point}:ro" \
${EXTRA_DOCKER_ARGS} \
--net leveros_default \
- leveros/ubuntubase:latest \
+ leveros/base:latest \
"${@:2}"
View
@@ -0,0 +1,7 @@
+FROM alpine:3.3
+
+LABEL com.leveros.isleveros="true"
+
+RUN apk update && apk upgrade \
+ && apk add bash ca-certificates \
+ && rm -rf /var/cache/apk/*
@@ -1,8 +1,11 @@
-FROM leveros/ubuntubase:latest
+FROM leveros/base:latest
+
+RUN apk add --update docker wget unzip \
+ && rm -rf /var/cache/apk/*
# Install consul.
-RUN bash -c "cd /usr/local/bin && wget https://releases.hashicorp.com/consul/0.6.3/consul_0.6.3_linux_amd64.zip && unzip consul_0.6.3_linux_amd64.zip && rm consul_0.6.3_linux_amd64.zip"
-RUN bash -c "mkdir -p /consul/ui && cd /consul/ui && wget https://releases.hashicorp.com/consul/0.6.3/consul_0.6.3_web_ui.zip && unzip consul_0.6.3_web_ui.zip && rm consul_0.6.3_web_ui.zip"
+RUN bash -c "cd /usr/local/bin && wget https://releases.hashicorp.com/consul/0.6.4/consul_0.6.4_linux_amd64.zip && unzip consul_0.6.4_linux_amd64.zip && rm consul_0.6.4_linux_amd64.zip"
+RUN bash -c "mkdir -p /consul/ui && cd /consul/ui && wget https://releases.hashicorp.com/consul/0.6.4/consul_0.6.4_web_ui.zip && unzip consul_0.6.4_web_ui.zip && rm consul_0.6.4_web_ui.zip"
RUN bash -c "mkdir -p /consul/data"
COPY conf.json /consul/conf/conf.json
@@ -1,39 +1,26 @@
-FROM ubuntu:latest
+FROM leveros/base:latest
-LABEL com.leveros.isleveros="true"
LABEL com.leveros.islevercontainer="true"
-RUN apt-get update
-RUN apt-get dist-upgrade -y
+RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories
+RUN echo '@community http://nl.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
-RUN apt-get install -y \
- build-essential \
+RUN apk add --update \
curl \
- dialog \
- git \
- libevent-dev \
- nano \
- net-tools \
+ libevent \
+ make \
+ nodejs@edge \
python \
- python-dev \
- python-distribute \
- python-pip \
- python-software-properties \
- software-properties-common \
tar \
unzip \
wget
-
-# Install NodeJS.
-RUN curl -sL https://deb.nodesource.com/setup_5.x | bash -
-RUN apt-get update
-RUN apt-get install -y nodejs
+RUN rm -rf /var/cache/apk/*
# This is really important to avoid Lever customers from running as root.
# Without ns remap it would mean that in case of a breakout they would have
# root access to the host.
-RUN groupadd -r lever
-RUN useradd -g lever -s /sbin/nologin lever
+RUN addgroup lever
+RUN adduser -D -G lever -s /sbin/nologin lever
USER lever
# Port listening on for Lever RPCs.
@@ -1,4 +1,4 @@
-FROM leveros/ubuntubase:latest
+FROM leveros/base:latest
COPY ./leveroshost /leveros/bin/
@@ -1,20 +0,0 @@
-FROM ubuntu:latest
-
-LABEL com.leveros.isleveros="true"
-
-RUN apt-get update
-RUN apt-get dist-upgrade -y
-RUN apt-get install -y \
- software-properties-common \
- apt-transport-https
-
-# Add docker repo (for using docker client for health checking).
-RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
-RUN add-apt-repository "deb https://apt.dockerproject.org/repo ubuntu-trusty main"
-
-RUN apt-get update
-RUN apt-get dist-upgrade -y
-RUN apt-get install -y \
- wget \
- unzip \
- docker-engine

0 comments on commit ef01a23

Please sign in to comment.