mirror of
https://github.com/kennethreitz/bake.git
synced 2026-06-05 14:50:19 +00:00
docker!
This commit is contained in:
@@ -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
|
||||
@@ -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" ]
|
||||
@@ -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" ]
|
||||
Executable
+6
@@ -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"
|
||||
Reference in New Issue
Block a user