Empire/Dockerfile

64 lines
1.7 KiB
Docker
Raw Normal View History

2017-12-03 22:11:43 +00:00
# NOTE: Only use this when you want to build image locally
# else use `docker pull empireproject\empire:{VERSION}`
# all image versions can be found at: https://hub.docker.com/r/empireproject/empire/
# -----BUILD COMMANDS----
# 1) build command: `docker build -t empireproject/empire .`
# 2) create volume storage: `docker create -v /opt/Empire --name data empireproject/empire`
# 3) run out container: `docker run -ti --volumes-from data empireproject/empire /bin/bash`
# -----RELEASE COMMANDS----
# 1) `USERNAME=empireproject`
# 2) `IMAGE=empire`
# 3) `git pull`
# 4) `export VERSION="$(curl -s https://raw.githubusercontent.com/EmpireProject/Empire/master/lib/common/empire.py | grep "VERSION =" | cut -d '"' -f2)"`
# 5) `docker tag $USERNAME/$IMAGE:latest $USERNAME/$IMAGE:$VERSION`
# 1) `docker push $USERNAME/$IMAGE:latest`
# 2) `docker push $USERNAME/$IMAGE:$VERSION`
# -----BUILD ENTRY-----
# image base
FROM ubuntu:16.04
2017-12-20 04:03:16 +00:00
# pull from BUILD
ARG empirversion
2017-12-03 22:11:43 +00:00
# extra metadata
2017-12-20 04:03:16 +00:00
LABEL maintainer="EmpireProject"
2017-12-03 22:11:43 +00:00
LABEL description="Dockerfile base for Empire server."
2017-12-20 04:03:16 +00:00
LABEL version=${empirversion}
2017-12-03 22:11:43 +00:00
2017-12-20 04:03:16 +00:00
# env setup
ENV STAGING_KEY=RANDOM
ENV DEBIAN_FRONTEND=noninteractive
# set the def shell for ENV
SHELL ["/bin/bash", "-c"]
# install basic build items
RUN apt-get update && apt-get install -qy \
wget \
curl \
git \
sudo \
apt-utils \
lsb-core \
2017-12-20 14:24:46 +00:00
python2.7
2017-12-03 22:11:43 +00:00
# cleanup image
2017-12-20 04:03:16 +00:00
RUN apt-get -qy clean \
autoremove
2017-12-03 22:11:43 +00:00
2017-12-20 04:03:16 +00:00
# build empire from source
2017-12-24 00:55:37 +00:00
# TODO: When we merge to master set branch to master
RUN git clone -b dev https://github.com/EmpireProject/Empire.git /opt/Empire && \
2017-12-20 04:03:16 +00:00
cd /opt/Empire/setup/ && \
./install.sh && \
2017-12-20 14:44:38 +00:00
rm -rf /opt/Empire/data/empire*
2017-12-03 22:11:43 +00:00
2017-12-20 04:03:16 +00:00
WORKDIR "/opt/Empire"
ENTRYPOINT ["./empire"]
2017-12-20 13:46:00 +00:00
2017-12-03 22:11:43 +00:00
# -----END OF BUILD-----