-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When this Dockerfile was originally defined there was not a pre-built compose image. Having that available dramatically simplifies the Dockerfile here. The need for upgrade comes from the fact that the previous version of Alpine was bringing along a very old version or Ruby (2.3) which is not longer supported and some gems were failing to install.
- Loading branch information
1 parent
f4022c6
commit 5fa105c
Showing
1 changed file
with
8 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,25 @@ | ||
FROM alpine:3.5 | ||
|
||
ARG DOCKER_VERSION=1.13.1 | ||
ARG COMPOSE_VERSION=1.11.2 | ||
FROM docker/compose:1.19.0 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
|
||
RUN \ | ||
# install dev dependencies | ||
apk --no-cache add \ | ||
apk --no-cache add --virtual .rundeps \ | ||
bash \ | ||
build-base \ | ||
curl \ | ||
docker \ | ||
git \ | ||
libffi-dev \ | ||
py-pip \ | ||
python \ | ||
ruby \ | ||
ruby-bundler \ | ||
ruby-dev \ | ||
openssh \ | ||
wget && \ | ||
|
||
# install docker | ||
mkdir /code && \ | ||
cd /code && \ | ||
wget \ | ||
--no-check-certificate \ | ||
-qO- \ | ||
https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz \ | ||
| tar xvz && \ | ||
mv docker/docker /usr/local/bin && \ | ||
|
||
# install docker-compose | ||
git \ | ||
clone \ | ||
--branch ${COMPOSE_VERSION} \ | ||
https://github.com/docker/compose.git \ | ||
/code/compose && \ | ||
cd /code/compose && \ | ||
pip \ | ||
--no-cache-dir install \ | ||
-r requirements.txt \ | ||
-r requirements-dev.txt \ | ||
pyinstaller==3.1.1 && \ | ||
git rev-parse --short HEAD > compose/GITSHA && \ | ||
ln -s /lib /lib64 && \ | ||
ln -s /lib/libc.musl-x86_64.so.1 ldd && \ | ||
ln -s /lib/ld-musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 && \ | ||
pyinstaller docker-compose.spec && \ | ||
unlink /lib/ld-linux-x86-64.so.2 /lib64 ldd || true && \ | ||
mv dist/docker-compose /usr/local/bin/docker-compose && \ | ||
chmod +x /usr/local/bin/docker-compose && \ | ||
|
||
# install ruby dependencies | ||
bundle install --gemfile=/usr/src/app/Gemfile --clean -j4 && \ | ||
|
||
# cleanup | ||
pip freeze | xargs pip uninstall -y && \ | ||
ruby-json | ||
|
||
apk del \ | ||
bash \ | ||
build-base \ | ||
ca-certificates \ | ||
libffi-dev \ | ||
py-pip \ | ||
python \ | ||
ruby-dev && \ | ||
RUN \ | ||
bundle install --gemfile=/usr/src/app/Gemfile --clean -j4 | ||
|
||
rm -rf /code /usr/lib/python2.7/ /root/.cache /var/cache/apk/* && \ | ||
rm -rf /usr/lib/ruby/gems/*/cache/* && \ | ||
rm -rf /var/cache/apk/* /tmp | ||
ENTRYPOINT [] | ||
|
||
CMD rake rspec:unit |