Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #4995 from mboersma/alpine-refresh
Browse files Browse the repository at this point in the history
chore(*): update base to alpine:3.3
  • Loading branch information
mboersma committed Apr 5, 2016
2 parents 67090ae + 06fd17c commit 52e96a5
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 49 deletions.
14 changes: 12 additions & 2 deletions builder/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ func keysToLocal(c cookoo.Context, client Getter, ciphers []string, etcdPath str
// It only fails if it cannot copy ssh_host_key to sshHostKey. All other
// abnormal conditions are logged, but not considered to be failures.
func keysToEtcd(c cookoo.Context, client Setter, ciphers []string, etcdPath string) error {
firstpath := ""
lpath := "/etc/ssh/ssh_host_%s_key"
privkey := "%s/sshHost%sKey"
for _, cipher := range ciphers {
Expand All @@ -288,10 +289,19 @@ func keysToEtcd(c cookoo.Context, client Setter, ciphers []string, etcdPath stri
} else if _, err := client.Set(key, string(content), 0); err != nil {
log.Errf(c, "Could not store ssh key in etcd: %s", err)
}
// Remember the first key's path in case the generic key is missing
if firstpath == "" {
firstpath = path
}
}
// Now we set the generic key:
if content, err := ioutil.ReadFile("/etc/ssh/ssh_host_key"); err != nil {
log.Errf(c, "Could not read the ssh_host_key file.")
keypath := "/etc/ssh/ssh_host_key"
if _, err := os.Stat(keypath); os.IsNotExist(err) && firstpath != "" {
// Use ssh_host_dsa_key if newer ssh-keygen didn't create ssh_host_key
keypath = firstpath
}
if content, err := ioutil.ReadFile(keypath); err != nil {
log.Errf(c, "Could not read the %s file.", keypath)
return err
} else if _, err := client.Set("sshHostKey", string(content), 0); err != nil {
log.Errf(c, "Failed to set sshHostKey in etcd.")
Expand Down
11 changes: 5 additions & 6 deletions builder/rootfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.2
FROM alpine:3.3

# install common packages
RUN apk add --update-cache curl bash sudo && rm -rf /var/cache/apk/*
RUN apk add --no-cache curl bash sudo

# install etcdctl
RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/get-deis/etcdctl-v0.4.9 \
Expand All @@ -11,19 +11,18 @@ RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/get-d
RUN curl -sSL -o /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v0.10.0/confd-0.10.0-linux-amd64 \
&& chmod +x /usr/local/bin/confd

RUN apk add --update-cache \
RUN apk add --no-cache \
coreutils \
device-mapper \
e2fsprogs \
git \
iptables \
libudev \
udev \
lxc \
openssh \
udev \
util-linux \
xz \
&& rm -rf /var/cache/apk/*
xz

# the docker package in alpine disables aufs and devicemapper
ENV DOCKER_BUCKET get.docker.com
Expand Down
4 changes: 2 additions & 2 deletions controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.2
FROM alpine:3.3

# install common packages
RUN apk add --update-cache curl bash sudo && rm -rf /var/cache/apk/*
RUN apk add --no-cache curl bash sudo

# install etcdctl
RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/get-deis/etcdctl-v0.4.9 \
Expand Down
7 changes: 3 additions & 4 deletions controller/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi

# install required system packages
# HACK: install git so we can install bacongobbler's fork of django-fsm
apk add --update-cache \
apk add --no-cache \
build-base \
git \
libffi-dev \
Expand All @@ -24,7 +24,7 @@ apk add --update-cache \
python-dev

# install pip
curl -sSL https://raw.githubusercontent.com/pypa/pip/7.0.3/contrib/get-pip.py | python -
curl -sSL https://bootstrap.pypa.io/get-pip.py | python - pip==8.1.1

# add a deis user
adduser deis -D -h /app -s /bin/bash
Expand All @@ -39,11 +39,10 @@ mkdir -p /templates && chown -R deis:deis /templates
pip install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt

# cleanup.
apk del --purge \
apk del --no-cache \
build-base \
git \
libffi-dev \
openldap-dev \
postgresql-dev \
python-dev
rm -rf /var/cache/apk/*
4 changes: 2 additions & 2 deletions database/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ apk add /tmp/pv-1.6.0-r0.apk
/etc/init.d/postgresql stop || true

# install pip
curl -sSL https://raw.githubusercontent.com/pypa/pip/7.0.3/contrib/get-pip.py | python -
curl -sSL https://bootstrap.pypa.io/get-pip.py | python - pip==8.1.1

# install wal-e
pip install --disable-pip-version-check --no-cache-dir wal-e==0.8.1 oslo.config>=1.12.0

# python port of daemontools
pip install --disable-pip-version-check --no-cache-dir envdir
pip install --disable-pip-version-check --no-cache-dir envdir==0.7

mkdir -p /etc/wal-e.d/env /etc/postgresql/main /var/lib/postgresql

Expand Down
2 changes: 1 addition & 1 deletion logger/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.2
FROM alpine:3.3

ENTRYPOINT ["/bin/logger"]
CMD ["--enable-publish"]
Expand Down
2 changes: 1 addition & 1 deletion logspout/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.2
FROM alpine:3.3

ENV DOCKER_HOST unix:///tmp/docker.sock
ENV ROUTESPATH /tmp
Expand Down
4 changes: 2 additions & 2 deletions publisher/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM alpine:3.2
FROM alpine:3.3

# install curl in the image so it is possible to get the runtime
# profiling information without any additional package installation.
RUN apk add --update-cache curl && rm -rf /var/cache/apk/*
RUN apk add --no-cache curl

ADD bin/publisher /usr/local/bin/publisher
ENTRYPOINT ["/usr/local/bin/publisher"]
Expand Down
4 changes: 2 additions & 2 deletions registry/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.1
FROM alpine:3.3

# install common packages
RUN apk add --update-cache curl bash sudo && rm -rf /var/cache/apk/*
RUN apk add --no-cache curl bash sudo

# install etcdctl
RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/get-deis/etcdctl-v0.4.9 \
Expand Down
19 changes: 7 additions & 12 deletions registry/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [[ -z $DOCKER_BUILD ]]; then
fi

# install required packages (copied from dotcloud/docker-registry Dockerfile)
apk add --update-cache \
apk add --no-cache \
build-base \
git \
openssl-dev \
Expand All @@ -22,16 +22,13 @@ apk add --update-cache \
xz-dev

# install pip
curl -sSL https://raw.githubusercontent.com/pypa/pip/7.0.3/contrib/get-pip.py | python -

# workaround to python > 2.7.8 SSL issues
pip install --disable-pip-version-check --no-cache-dir pyopenssl ndg-httpsclient pyasn1
curl -sSL https://bootstrap.pypa.io/get-pip.py | python - pip==8.1.1

# create a registry user
adduser -D -s /bin/bash registry

# add the docker registry source from github
git clone -b new-repository-import-master --single-branch https://github.com/deis/docker-registry /docker-registry && \
git clone -b deis-v1-lts --single-branch https://github.com/deis/docker-registry /docker-registry && \
chown -R registry:registry /docker-registry

# install boto configuration
Expand All @@ -44,14 +41,12 @@ pip install --disable-pip-version-check --no-cache-dir /docker-registry/depends/
# Install registry
pip install --disable-pip-version-check --no-cache-dir "file:///docker-registry#egg=docker-registry[bugsnag,newrelic,cors]"

patch \
"$(python -c 'import boto; import os; print os.path.dirname(boto.__file__)')/connection.py" \
< /docker-registry/contrib/boto_header_patch.diff
# patch boto
cd "$(python -c 'import boto; import os; print os.path.dirname(boto.__file__)')" \
&& patch -i /docker-registry/contrib/boto_header_patch.diff connection.py

# cleanup. indicate that python is a required package.
apk del --purge \
apk del --no-cache \
build-base \
linux-headers \
python-dev

rm -rf /var/cache/apk/*
7 changes: 3 additions & 4 deletions router/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
FROM alpine:3.2
FROM alpine:3.3

# install common packages
RUN apk add --update-cache \
RUN apk add --no-cache \
bash \
curl \
geoip \
libssl1.0 \
openssl \
pcre \
sudo \
&& rm -rf /var/cache/apk/*
sudo

# install confd
RUN curl -sSL -o /usr/local/bin/confd https://s3-us-west-2.amazonaws.com/opdemand/confd-git-73f7489 \
Expand Down
5 changes: 2 additions & 3 deletions router/rootfs/bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mkdir "$BUILD_PATH"
cd "$BUILD_PATH"

# install required packages to build
apk add --update-cache \
apk add --no-cache \
build-base \
curl \
geoip-dev \
Expand Down Expand Up @@ -78,7 +78,7 @@ cd "$BUILD_PATH/nginx-$NGINX_VERSION"
&& make && make install

rm -rf "$BUILD_PATH"
apk del --purge \
apk del --no-cache \
build-base \
curl \
geoip-dev \
Expand All @@ -89,4 +89,3 @@ apk del --purge \
openssl-dev \
zlib \
zlib-dev
rm -rf /var/cache/apk/*
4 changes: 2 additions & 2 deletions tests/fixtures/mock-store/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.2
FROM alpine:3.3

# install common packages
RUN apk add --update-cache curl bash sudo && rm -rf /var/cache/apk/*
RUN apk add --no-cache curl bash sudo

WORKDIR /app
EXPOSE 8888
Expand Down
8 changes: 4 additions & 4 deletions tests/fixtures/mock-store/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [[ -z $DOCKER_BUILD ]]; then
fi

# install required packages to build
apk add --update-cache \
apk add --no-cache \
build-base \
curl \
file \
Expand All @@ -30,13 +30,13 @@ git checkout 4c3c3752f990db97e8969c00666251a3b427ef4c
git apply /tmp/mock-s3-patch.diff

# install pip
curl -sSL https://raw.githubusercontent.com/pypa/pip/7.0.3/contrib/get-pip.py | python -
curl -sSL https://bootstrap.pypa.io/get-pip.py | python - pip==8.1.1

python setup.py install

# cleanup.
apk del --purge \
apk del --no-cache \
build-base \
gcc \
git
rm -rf /var/cache/apk/* /tmp/*
rm -rf /tmp/*
4 changes: 2 additions & 2 deletions tests/fixtures/test-etcd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.2
FROM alpine:3.3

# install common packages
RUN apk add --update-cache curl tar && rm -rf /var/cache/apk/*
RUN apk add --no-cache curl tar

# ETCD_VERSION is actually used by the etcd daemon, and causes an issue if we
# format it for our use here. So, we call this something else.
Expand Down

0 comments on commit 52e96a5

Please sign in to comment.