From b48e621b601c17887452e905c1137694ff2da1ea Mon Sep 17 00:00:00 2001
From: Alejandro Tjaarda <alexdecb@yahoo.es>
Date: Fri, 27 Sep 2024 19:11:20 +0000
Subject: [PATCH] switch: added ned image

---
 build/ned/Dockerfile | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 build/ned/Dockerfile

diff --git a/build/ned/Dockerfile b/build/ned/Dockerfile
new file mode 100644
index 0000000..2c4e20c
--- /dev/null
+++ b/build/ned/Dockerfile
@@ -0,0 +1,26 @@
+FROM golang:1.21 AS build
+
+WORKDIR /usr/src/l2sm-ned
+
+COPY ./src/switch/  ./
+
+RUN go build -v -o /usr/local/bin/ned-server ./cmd/ned-server
+
+FROM ubuntu:latest 
+
+WORKDIR /usr/local/bin
+
+COPY ./src/switch/vswitch.ovsschema /tmp/
+
+COPY --from=build /usr/local/bin/ .
+
+RUN apt-get update && \
+  apt-get install -y net-tools iproute2 netcat-openbsd dnsutils curl iputils-ping iptables nmap tcpdump openvswitch-switch && \
+  mkdir /var/run/openvswitch && mkdir -p /etc/openvswitch && ovsdb-tool create /etc/openvswitch/conf.db /tmp/vswitch.ovsschema 
+
+COPY ./src/switch/setup_ned.sh .
+
+RUN chmod +x ./setup_ned.sh && \
+    mkdir /etc/l2sm/
+
+CMD [ "./setup_ned.sh" ]
\ No newline at end of file
-- 
GitLab