Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

Commit 6f29487

Browse files
committed
new base image, ansible provisioning (faster and smaller image size)
1 parent 8163328 commit 6f29487

12 files changed

Lines changed: 119 additions & 99 deletions

File tree

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ services:
44
- docker
55

66
script:
7-
- docker build -t computerfr33k/burp-server .
7+
- docker build \
8+
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
9+
--build-arg VCS_REF=`git rev-parse --short HEAD` \
10+
-t burp-server:latest .

Dockerfile

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,23 @@
1-
# Use phusion/baseimage as base image. To make your builds reproducible, make
2-
# sure you lock down to a specific version, not to `latest`!
3-
# See https://github.com/phusion/baseimage-docker/blob/master/Changelog.md for
4-
# a list of version numbers.
5-
FROM phusion/baseimage:0.9.19
1+
FROM webdevops/base:ubuntu-16.04
62
MAINTAINER Eric Pfeiffer
73

8-
ENV DEBIAN_FRONTEND="noninteractive" HOME="/root" TERM="xterm"
9-
ENV BASE_APTLIST="make pkg-config check g++ librsync-dev libz-dev libssl-dev uthash-dev libyajl-dev autoconf automake libtool git libncurses5 libacl1-dev"
10-
ENV APTLIST=""
11-
ENV BURP_VERSION="1.4.40"
4+
# Build-time metadata as defined at http://label-schema.org
5+
ARG BUILD_DATE
6+
ARG VCS_REF
7+
LABEL org.label-schema.build-date=$BUILD_DATE \
8+
org.label-schema.docker.dockerfile="/Dockerfile" \
9+
org.label-schema.license="AGPLv3" \
10+
org.label-schema.name="burp - backup and restore program" \
11+
org.label-schema.url="http://burp.grke.net/" \
12+
org.label-schema.vcs-ref=$VCS_REF \
13+
org.label-schema.vcs-type="Git" \
14+
org.label-schema.vcs-url="https://github.com/computerfr33k/docker-burp-backup-server"
1215

13-
ADD init/ /etc/my_init.d/
14-
ADD service/ /etc/service/
15-
ADD cron.d/ /etc/cron.d/
16-
RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh
16+
COPY conf/ /opt/docker/
1717

18-
RUN useradd -u 911 -U -d /config -s /bin/false abc && \
19-
usermod -G users abc && \
20-
mkdir -p /app/aptselect /config /defaults /data && \
21-
apt-get update && \
22-
apt-get install -qy python-pip && \
23-
pip install apt-select && \
24-
apt-get install -y python3-bs4 $BASE_APTLIST && \
25-
apt-get upgrade -y -o Dpkg::Options::="--force-confold"
26-
27-
# Use baseimage-docker's init system.
28-
CMD ["/sbin/my_init"]
29-
30-
# Install Burp Server
31-
RUN git clone --depth 1 --branch "$BURP_VERSION" https://github.com/grke/burp.git /tmp/burp && \
32-
cd /tmp/burp && \
33-
./configure --prefix=/app --sysconfdir=/defaults --localstatedir=/var && \
34-
make && \
35-
make install
36-
37-
ENV PATH=$PATH:/app/usr/sbin
38-
39-
RUN sed -i 's/^directory =.*/directory = \/data/g' /defaults/burp-server.conf && \
40-
sed -i 's/\/etc\/burp/\/config/g' /defaults/burp-server.conf && \
41-
sed -i 's/\/usr\/sbin/\/app\/usr\/sbin/g' /defaults/burp-server.conf && \
42-
sed -i 's/\/etc\/burp/\/config/g' /defaults/CA.cnf && \
43-
sed -i 's/^pidfile =.*/pidfile = \/app\/burp.server.pid/g' /defaults/burp-server.conf
44-
45-
RUN sed -i 's/^directory =.*/directory = \/data/g' /defaults/burp.conf && \
46-
sed -i 's/\/etc\/burp/\/config/g' /defaults/burp.conf && \
47-
sed -i 's/^stdout =.*/stdout = 1/g' /defaults/burp.conf && \
48-
sed -i 's/\/usr\/sbin/\/app\/usr\/sbin/g' /defaults/burp.conf && \
49-
sed -i 's/\/etc\/burp/\/config/g' /defaults/CA.cnf
50-
51-
# Clean up APT when done.
52-
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
18+
RUN /opt/docker/bin/provision run --tag bootstrap --role burp-server \
19+
&& /opt/docker/bin/bootstrap.sh
5320

5421
VOLUME ["/config", "/data"]
22+
5523
EXPOSE 4971 4972

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Docker Image
2+
3+
[![](https://images.microbadger.com/badges/image/computerfr33k/burp-server.svg)](http://microbadger.com/images/computerfr33k/burp-server "Get your own image badge on microbadger.com")
4+
[![](https://images.microbadger.com/badges/version/computerfr33k/burp-server.svg)](http://microbadger.com/images/computerfr33k/burp-server "Get your own version badge on microbadger.com")
5+
6+
# Build
7+
18
[![Build Status](https://travis-ci.org/computerfr33k/docker-burp-backup-server.svg?branch=master)](https://travis-ci.org/computerfr33k/docker-burp-backup-server)
29

310
# computerfr33k/burp-server
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
3+
APPLICATION_UID: "{{ lookup('env','APPLICATION_UID') }}"
4+
APPLICATION_GID: "{{ lookup('env','APPLICATION_GID') }}"
5+
6+
BURP_VERSION: "1.4.40"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
3+
- include: bootstrap/build_dependencies.yml
4+
- include: bootstrap/burp_server.yml
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
3+
- name: Update System Packages
4+
apt:
5+
update_cache: yes
6+
upgrade: dist
7+
8+
- name: Install Build Dependencies
9+
apt:
10+
state: latest
11+
name: "{{ item }}"
12+
with_items:
13+
- librsync1
14+
- librsync-dev
15+
- libz-dev
16+
- libssl-dev
17+
- uthash-dev
18+
- libncurses5-dev
19+
- libacl1-dev
20+
- make
21+
- g++
22+
- gcc
23+
- git
24+
25+
- action: setup
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
3+
- name: Download Burp Server
4+
git:
5+
depth: 1
6+
repo: "https://github.com/grke/burp.git"
7+
version: "{{ BURP_VERSION }}"
8+
dest: /tmp/burp
9+
10+
- shell: ./configure --sysconfdir=/defaults --localstatedir=/var && make && make install
11+
args:
12+
chdir: /tmp/burp
13+
14+
- name: Remove Build Dependencies (Free-up Space)
15+
apt:
16+
name: "{{ item }}"
17+
state: absent
18+
autoremove: yes
19+
with_items:
20+
- librsync-dev
21+
- libz-dev
22+
- libssl-dev
23+
- uthash-dev
24+
- libncurses5-dev
25+
- libacl1-dev
26+
- make
27+
- g++
28+
- gcc
29+
- git
30+
31+
- action: setup
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
3+
- include: bootstrap.yml
4+
tags:
5+
- bootstrap
6+
7+
- include: entrypoint.yml
8+
tags:
9+
- entrypoint

init/10_add_user_abc.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
4+
5+
PUID=${PUID:-911}
6+
PGID=${PGID:-911}
7+
8+
if [ ! "$(id -u abc)" -eq "$PUID" ]; then usermod -o -u "$PUID" abc ; fi
9+
if [ ! "$(id -g abc)" -eq "$PGID" ]; then groupmod -o -g "$PGID" abc ; fi
10+
11+
chown abc:abc /app
12+
chown abc:abc /config
13+
chown abc:abc /defaults
14+
chown abc:abc /data

0 commit comments

Comments
 (0)