This commit is contained in:
2019-09-17 23:18:29 -04:00
parent bdaccf456a
commit 4c35d2e705
4 changed files with 97 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
# This docker-compose setup is intented for development, testing, and CI purposes.
# -- Make changes with extreme caution!
# Note: CircleCI Docker runners don't support volumes.
version: "3.4"
# Services are meant to be interchangeble between running them locally or
# inside a container. That is why all of them export their server port to the host.
# Images that are built here are the same used in production.
services:
core:
image: kennethreitz/bake:core
build:
context: .
dockerfile: ./docker/core.Dockerfile
bake:
image: kennethreitz/bake:${DOCKER_RELEASE:-latest}
build:
context: .
dockerfile: ./docker/bake.Dockerfile
depends_on:
- core
volumes:
- ./Bakefile:/app/Bakefile
- .:/app
+25
View File
@@ -0,0 +1,25 @@
FROM kennethreitz/bake:core
ENV BAKEFILE_PATH /app/Bakefile
# -- Install Shellcheck.
RUN set -ex && \
apt-get install shellcheck -y -qq && \
apt-get clean -y -qq && \
apt-get autoclean -y -qq
# -- Install latest Bake.
RUN set -ex && \
pip3 install bake-cli --upgrade --quiet > /dev/null
# -- Really slim down that image.
RUN set -ex && \
rm -fr /var/lib/apt/lists
# -- Copy Bakefile of depending Dockerfiles.
ONBUILD COPY ./Bakefile /app/Bakefile
# -- Copy the application over.
ONBUILD COPY . /app
ENTRYPOINT [ "bake" ]
+38
View File
@@ -0,0 +1,38 @@
FROM ubuntu:19.04
# Tell Ubuntu to not prompt during apt installs.
ENV DEBIAN_FRONTEND 'noninteractive'
# -- Setup mirrors, for faster downloads (main sources can be *very* slow sometimes).
COPY ./docker/scripts/use-mirrors.sh /opt/use-mirrors.sh
RUN set -ex && \
/opt/use-mirrors.sh && \
rm -fr /opt/use-mirrors.sh
# -- System dependencies + common utilities.
RUN set -ex && \
apt-get update -qq && \
apt-get upgrade -y -qq && \
apt-get install curl python3 python3-distutils -y -qq >/dev/null && \
apt-get clean -y -qq && \
apt-get autoclean -y -qq
# -- Install pip.
RUN set -ex && curl -s --retry 3 https://bootstrap.pypa.io/get-pip.py > /tmp/get-pip.py && \
python3 /tmp/get-pip.py > /dev/null && rm -fr /tmp/get-pip.py
# -- Install hconfig.
RUN set -ex && \
pip3 install pipenv --quiet --no-cache 2>/dev/null
# -- Clean up.
RUN set -ex && \
apt-get clean -y -qq && apt-get autoremove -y -qq && apt-get autoclean -y -qq
# -- Home directory.
RUN set -ex && \
mkdir /app
WORKDIR /app
ENTRYPOINT [ "bash" ]
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
SOURCES_LIST='/etc/apt/sources.list'
PREVIOUS_SOURCES=$(cat $SOURCES_LIST)
perl -pe '/(http|https):\/\/(.*?)(\/|$)/ && s/$2/mirror.math.princeton.edu\/pub\//g' <<< "$PREVIOUS_SOURCES" > "$SOURCES_LIST"