mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Bake docker-ce into the base image
Speeds up CI runs by quite a bit
This commit is contained in:
22
.circleci/base-image/Dockerfile
Normal file
22
.circleci/base-image/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM continuumio/miniconda3:4.5.4
|
||||
|
||||
|
||||
RUN apt-get update --yes
|
||||
|
||||
RUN apt-get install --yes --no-install-recommends \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg2 \
|
||||
software-properties-common
|
||||
|
||||
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
|
||||
|
||||
RUN add-apt-repository \
|
||||
"deb [arch=amd64] https://download.docker.com/linux/debian \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
|
||||
RUN apt-get update --yes
|
||||
|
||||
RUN apt-get install --yes docker-ce
|
||||
16
.circleci/base-image/README.rst
Normal file
16
.circleci/base-image/README.rst
Normal file
@@ -0,0 +1,16 @@
|
||||
========================
|
||||
TLJH CircleCI Base Image
|
||||
========================
|
||||
|
||||
Miniconda should be installed in the base CircleCI image for our unit tests.
|
||||
Docker CE should be installed in the base CircleCI image for our integration tests.
|
||||
|
||||
This image contains both, so we do not have to build it every single time.
|
||||
|
||||
Updating the image
|
||||
==================
|
||||
|
||||
1. Make changes to the ``Dockerfile`` & commit it.
|
||||
2. Run ``./build.bash`` from this directory. It'll build, tag & push the image with
|
||||
the hash of the last commit that touched this directory.
|
||||
3. Use the new image tag in the ``.circleci/config.yml`` file.
|
||||
15
.circleci/base-image/build.bash
Executable file
15
.circleci/base-image/build.bash
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Very simple script to build and push images
|
||||
# Should be replaced by chartpress or similar at some point
|
||||
# Uses google container image builder for simplicity
|
||||
IMAGE="jupyterhub/tljh-circleci-base-image"
|
||||
TAG=$(git log -n1 --pretty="%h" .)
|
||||
IMAGE_SPEC="${IMAGE}:${TAG}"
|
||||
|
||||
|
||||
echo "Building and pushing ${IMAGE_SPEC}"
|
||||
docker build -t ${IMAGE_SPEC} .
|
||||
docker push ${IMAGE_SPEC}
|
||||
echo "Built and pushed ${IMAGE_SPEC}"
|
||||
@@ -2,7 +2,7 @@ version: 2
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: continuumio/miniconda3:4.5.4
|
||||
- image: jupyterhub/tljh-circleci-base-image:6fe5372
|
||||
|
||||
working_directory: ~/repo
|
||||
|
||||
@@ -34,29 +34,6 @@ jobs:
|
||||
# Run full installer test
|
||||
- setup_remote_docker
|
||||
|
||||
- run:
|
||||
#FIXME: Bake this into the base image
|
||||
name: install docker
|
||||
command: |
|
||||
apt-get update
|
||||
|
||||
apt-get install --yes \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg2 \
|
||||
software-properties-common
|
||||
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
|
||||
add-apt-repository \
|
||||
"deb [arch=amd64] https://download.docker.com/linux/debian \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get install --yes docker-ce
|
||||
|
||||
- run:
|
||||
name: build systemd image
|
||||
command: |
|
||||
|
||||
Reference in New Issue
Block a user