-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
131 lines (117 loc) · 4.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Copyright © 2018 Héctor Fiel < https://github.com/hfiel >
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# The license text is available at https://www.gnu.org/licenses/agpl-3.0.html
FROM ubuntu:18.04
LABEL name="docker-snort-compile"
LABEL maintainer="Hector Fiel https://github.com/hfiel/"
LABEL repository="https://github.com/hfiel/docker-snort-compile"
LABEL version="0.1"
LABEL description="This dockerfile contains a development environment to \
compile snort from source."
#================================
# Build arguments
#================================
ENV BUILD_TIMESTAMP 201810120940
ENV LOCALE en_US.UTF-8
EXPOSE 22
#================================
# TIMEZONE
#================================
## Set UTC timezone
RUN ln -snf /usr/share/UTC /etc/localtime && \
echo UTC > /etc/timezone
#================================
# APT - MAIN
# NOTE: to reduce number and size of layers, you usually you use apt-get install only once in the dockerfile
# Since the build dependencies can change, I use TWO separated apt-get install to speed up building
# If you need to add more dependencies, please do in the APT - BUILD DEPENDENCIES section
#================================
COPY assets/docker-snort-compile/etc/apt /assets/docker-snort-compile/etc/apt
RUN /bin/bash -c 'ln -fs /assets/docker-snort-compile/etc/apt/sources.list /etc/apt/sources.list' && /bin/bash -c 'ln -fs /assets/docker-snort-compile/etc/apt/apt.conf.d/99recommends /etc/apt/apt.conf.d/99recommends'
#base system update and install
RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
# Debian base system and tools
bash-completion \
fontconfig \
less \
locales \
rsync \
sudo \
supervisor \
tree \
unzip \
ca-certificates \
# Debian network tools
curl \
wget \
# Editors and development
vim \
git \
build-essential \
checkinstall \
# SSH
openssh-client \
openssh-server \
# end
&& \
# clean up
apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/{apt,dpkg,cache,log}/ && \
rm -rf /var/lib/apt/lists/*
#================================
# LOCALES
#================================
RUN locale-gen $LOCALE && update-locale LANG=$LOCALE
#================================
# SSH
#================================
RUN mkdir -p /var/run/sshd
#================================
# APT - BUILD DEPENDENCIES
#================================
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
# snort dependencies
libpcap-dev \
libpcre3-dev \
libdumbnet-dev \
zlib1g-dev \
liblzma-dev \
openssl \
libssl-dev \
libnghttp2-dev \
libluajit-5.1-dev \
# DAQ dependencies
libnetfilter-queue-dev \
bison \
flex \
# end
&& \
# clean up
apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/{apt,dpkg,cache,log}/ && \
rm -rf /var/lib/apt/lists/*
#================================
# LOAD ASSETS
#================================
COPY assets/docker-snort-compile /assets/docker-snort-compile
ENTRYPOINT ["/assets/docker-snort-compile/bin/entrypoint_docker-snort-compile"]