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

Commit 7429e47

Browse files
committed
rewrite the docker image to use alpine linux w/ ansible.
1 parent 6bc53e1 commit 7429e47

19 files changed

Lines changed: 150 additions & 158 deletions

File tree

Dockerfile

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
1-
FROM webdevops/base:ubuntu-16.04
2-
MAINTAINER Eric Pfeiffer
1+
FROM webdevops/base:alpine-3
32

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"
3+
VOLUME ["/data", "/etc/burp"]
154

16-
COPY conf/ /opt/docker/
17-
18-
RUN /opt/docker/bin/provision run --tag bootstrap --role burp-server \
19-
&& /opt/docker/bin/bootstrap.sh
5+
EXPOSE 4971 4972
206

21-
VOLUME ["/config", "/data"]
7+
COPY conf/ /opt/docker/
228

23-
EXPOSE 4971 4972
9+
RUN /usr/local/bin/apk-upgrade \
10+
&& /usr/local/bin/apk-install \
11+
librsync \
12+
librsync-dev \
13+
zlib-dev \
14+
zlib \
15+
openssl-dev \
16+
openssl \
17+
ncurses-dev \
18+
ncurses \
19+
acl-dev \
20+
libacl \
21+
attr-dev \
22+
libattr \
23+
make \
24+
gcc \
25+
g++ \
26+
make \
27+
git \
28+
rsync \
29+
libstdc++ \
30+
libgcc \
31+
# Build and install burp server
32+
&& /opt/docker/bin/provision add --tag bootstrap --tag entrypoint burp-server \
33+
&& /opt/docker/bin/bootstrap.sh \
34+
&& rm -rf /tmp/* \
35+
# Remove Dev Libraries
36+
&& apk del \
37+
librsync-dev \
38+
zlib-dev \
39+
openssl-dev \
40+
ncurses-dev \
41+
acl-dev \
42+
attr-dev \
43+
make \
44+
gcc \
45+
g++ \
46+
make \
47+
git

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Docker Image
22

33
[![](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+
45
[![](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")
56

67
# Build
@@ -16,38 +17,25 @@
1617
```
1718
docker create \
1819
--name="burp-server" \
19-
-v /path/to/config/data:/config \
20+
-v /path/to/config/dir:/etc/burp \
2021
-v /path/to/backups:/data \
21-
-v /etc/localtime:/etc/localtime:ro \
22-
-e PGID=<gid> -e PUID=<uid> \
2322
-p 4971:4971 -p 4972:4972 \
2423
computerfr33k/burp-server:<VERSION>
2524
```
2625

2726
**Parameters**
2827

2928
* `-p 4971 -p 4972` - the port(s)
30-
* `-v /etc/localtime` for timesync - *optional*
31-
* `-v /config` - Configuration file location
29+
* `-v /etc/burp` - Configuration file location
3230
* `-v /data` - Location for backups
33-
* `-e PGID` for GroupID - see below for explanation - *optional*
34-
* `-e PUID` for UserID - see below for explanation - *optional*
3531
* `-e ENABLE_CRON_SUMMARY=1` - Enables emailing a daily summary - *optional*
3632
* `-e BURP_EMAIL="[email protected]"` - Sets the email address to send the daily summary to. - *only required if cron summary is enabled*
3733
* `-e DISABLE_CRON_DEDUP=1` - Disables running dedup cron job - *optional*
3834

39-
It is based on phusion-baseimage with ssh removed, for shell access whilst the container is running do `docker exec -it burp-server /bin/bash`.
40-
41-
### User / Group Identifiers
42-
43-
**TL;DR** - The `PGID` and `PUID` values set the user / group you'd like your container to 'run as' to the host OS. This can be a user you've created or even root (not recommended).
44-
45-
Part of what makes our containers work so well is by allowing you to specify your own `PUID` and `PGID`. This avoids nasty permissions errors with relation to data volumes (`-v` flags). When an application is installed on the host OS it is normally added to the common group called users, Docker apps due to the nature of the technology can't be added to this group. So we added this feature to let you easily choose when running your containers.
35+
It is based on alpine linux with ssh disabled, for shell access whilst the container is running do `docker exec -it burp-server /bin/bash`.
4636

4737
## Setting up the application
4838

49-
*Please Note: /etc/burp is located as /config in the docker container.*
50-
5139
See the [docs](http://burp.grke.org/docs.html)
5240

5341
## Versions
@@ -61,8 +49,10 @@ The version number corresponds to what version of burp server you want to run. T
6149

6250
## Updates
6351

52+
* The docker image is now based on alpine linux and configs are now located in `/etc/burp`.
6453
* To monitor the logs of the container in realtime `docker logs -f burp-server`.
6554

6655
## Version History
6756

57+
+ **09/12/2016:** Base on Alpine Linux w/ ansible provisioning
6858
+ **07/12/2016:** Inital Release

conf/etc/supervisor.d/burp.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[group:burp]
2+
programs=burp-server
3+
priority=20
4+
5+
[program:burp-server]
6+
command = /usr/sbin/burp -c /etc/burp/burp-server.conf -F
7+
process_name=%(program_name)s
8+
startsecs = 0
9+
autostart = true
10+
autorestart = true
11+
startretries = 5
12+
stdout_logfile=/dev/stdout
13+
stdout_logfile_maxbytes=0
14+
stderr_logfile=/dev/stderr
15+
stderr_logfile_maxbytes=0

conf/etc/supervisor.d/cron.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[group:cron]
2+
programs=crond
3+
priority=25
4+
5+
[program:crond]
6+
command = /opt/docker/bin/service.d/cron.sh
7+
process_name=%(program_name)s
8+
startsecs = 0
9+
autostart = true
10+
autorestart = true
11+
stdout_logfile=/dev/stdout
12+
stdout_logfile_maxbytes=0
13+
stderr_logfile=/dev/stderr
14+
stderr_logfile_maxbytes=0
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
22

3-
APPLICATION_UID: "{{ lookup('env','APPLICATION_UID') }}"
4-
APPLICATION_GID: "{{ lookup('env','APPLICATION_GID') }}"
3+
APPLICATION_UID: "{{ lookup('env', 'APPLICATION_UID') }}"
4+
APPLICATION_GID: "{{ lookup('env', 'APPLICATION_GID') }}"
55

6-
BURP_VERSION: "1.4.40"
6+
BURP_VERSION: "1.4.40"
7+
8+
# Burp Cronjobs
9+
ENABLE_CRON_DEDUP: "{{ lookup('env', 'ENABLE_CRON_DEDUP') | default(True) }}"
10+
ENABLE_CRON_SUMMARY: "{{ lookup('env', 'ENABLE_CRON_SUMMARY') | default(False) }}"
11+
BURP_EMAIL: "{{ lookup('env', 'BURP_EMAIL') }}"
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
---
22

3-
- include: bootstrap/build_dependencies.yml
43
- include: bootstrap/burp_server.yml

conf/provision/roles/burp-server/tasks/bootstrap/build_dependencies.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
---
22

33
- name: Update System Packages
4-
apt:
4+
apk:
55
update_cache: yes
6-
upgrade: dist
6+
upgrade: yes
77

88
- name: Install Build Dependencies
9-
apt:
9+
apk:
1010
state: latest
1111
name: "{{ item }}"
1212
with_items:
13-
- librsync1
13+
- librsync
1414
- librsync-dev
15-
- libz-dev
16-
- libssl-dev
17-
- uthash-dev
18-
- libncurses5-dev
19-
- libacl1-dev
15+
- zlib-dev
16+
- openssl-dev
17+
- ncurses-dev
18+
- acl-dev
2019
- make
2120
- g++
2221
- gcc

conf/provision/roles/burp-server/tasks/bootstrap/burp_server.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,17 @@
77
version: "{{ BURP_VERSION }}"
88
dest: /tmp/burp
99

10-
- shell: ./configure --sysconfdir=/defaults --localstatedir=/var && make && make install
10+
- shell: ./configure --sysconfdir=/defaults --localstatedir=/data && make && make install
1111
args:
1212
chdir: /tmp/burp
1313

14-
- name: Remove Build Dependencies (Free-up Space)
15-
apt:
16-
name: "{{ item }}"
17-
state: absent
18-
autoremove: yes
14+
- file: path="{{ item }}" state=directory mode=0700
1915
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
16+
- /etc/burp
17+
- /data
18+
19+
- lineinfile: dest=/defaults/burp-server.conf state=present regexp="^directory =" line="directory = /data"
20+
21+
- lineinfile: dest=/defaults/burp-server.conf state=present regexp="^stdout =" line="stdout = 1"
3022

3123
- action: setup
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
---
22

3-
3+
- include: entrypoint/copy_configs.yml
4+
- include: entrypoint/cron_env.yml
5+
- include: entrypoint/dedup_cron.yml
6+
- include: entrypoint/burp_summary_cron.yml

0 commit comments

Comments
 (0)