It works but probably doesn't run Anchor in the best way. Once this is in the repo I can create a docker build job that will auto generate a new upstream anchor image each time a new merge occurs. When that is established, the process for running the container can be simplified. Change-Id: Ida199d4286a4b476e52d69864c97ff24633ca073
38 lines
995 B
Docker
38 lines
995 B
Docker
FROM ubuntu:latest
|
||
MAINTAINER Robert Clark <hyakuhei@gmail.com>
|
||
|
||
# root user operations
|
||
# Upgrade the base and install required packages
|
||
RUN apt-get update && apt-get install -y \
|
||
python-dev \
|
||
libssl-dev \
|
||
libffi-dev \
|
||
python-pip \
|
||
git
|
||
|
||
# Clone Anchor, install required python packages
|
||
# Setup a user to run anchor
|
||
WORKDIR /root
|
||
RUN git clone git://git.openstack.org/openstack/anchor
|
||
WORKDIR /root/anchor
|
||
RUN pip install -e .
|
||
RUN adduser --disabled-password --gecos '' anchor
|
||
|
||
# anchor user operations
|
||
RUN cp config.py /home/anchor/
|
||
RUN cp config.json /home/anchor/
|
||
RUN chown anchor:anchor /home/anchor/config.py
|
||
RUN chown anchor:anchor /home/anchor/config.json
|
||
RUN su - anchor
|
||
WORKDIR /home/anchor
|
||
RUN mkdir CA
|
||
RUN openssl req -out CA/root-ca.crt \
|
||
-keyout CA/root-ca-unwrapped.key \
|
||
-newkey rsa:4096 \
|
||
-subj "/CN=Anchor Test CA" \
|
||
-nodes \
|
||
-x509 \
|
||
-days 365
|
||
RUN chmod 0400 CA/root-ca-unwrapped.key
|
||
ENTRYPOINT ["/usr/local/bin/pecan", "serve", "/home/anchor/config.py"]
|