Data container Dockerfile (using debian just because I want git with https support, this could be something much smaller)
FROM debian:jessie
ENV DOMINO_ECR_NAMESPACE /ecr-data
# this would be part of a git-type ECR prep-script
RUN apt-get update &&\
apt-get install -y git
RUN mkdir -p $DOMINO_ECR_NAMESPACE && cd $DOMINO_ECR_NAMESPACE
# this would be constructed on the server with something like the following for git:
# cmd=git clone
# url=https://..../domino.git
# unique_name=domino
# s"$cmd $url $unique_name"
RUN git clone https://<your personal access token>@github.com/cerebrotech/domino.git $DOMINO_ECR_NAMESPACE/domino
# this would be created on the server, too
VOLUME /ecr-data/domino
Build the image and create the docker data container, naming it based on the run ids
$ docker build -t ecr-git-domino .
$ docker run --name ecr-git-domino-run-1234abcd ecr-git-domino true
$ docker run --name ecr-git-domino-run-5678efgh ecr-git-domino true
Execute a run container, mounting the volumes from the data container
$ docker run --rm --volumes-from ecr-git-domino-run-1234abcd --name domino-run-1234abcd -ti busybox
$ docker run --rm --volumes-from ecr-git-domino-run-5678efgh --name domino-run-5678efgh -ti busybox