-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (39 loc) · 1.98 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
# syntax=docker/dockerfile:1
##########################################################################
# This file is part of the Docker-Networks' Lab session support files.
# Copyright (C) 2022-2023 Eric Roy <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
##########################################################################
# Builds an Ubuntu image with some very basic tools to configure and test
# network connectivity.
#
# Build image with: `docker build -t docker-networks-img .`
# Note: You don't need to build this image manually.
# This file is overcommented for educational purposes
# All images start from some base image, in our case a fresh (and empty) Ubuntu.
FROM ubuntu:22.04
# It is a good practice to tell who the maintainer is. Before it was done
# with `MANTAINER <name> <email>` but it's now depreceated.
LABEL maintainer="Eric Roy Almonacid <[email protected]>"
LABEL version="1.1"
# Here come the commands nedded to install everything we need.
# As each line can be cached, it's preferable to install one package per line.
RUN apt-get update -y
RUN apt-get install -y apt-utils iproute2 iputils-ping iptables tcpdump nano
# This is the command that will be run AFTER the installation:
# - Commands starting with RUN are executed in `docker build`
# - The command (only one!) starting with CMD is executed at `docker run`.
CMD bash
# Stop (but not remove) the container by exiting bash.