Skip to content
Snippets Groups Projects
Commit 94a86ce8 authored by leo1995's avatar leo1995
Browse files

created 3 different sancus dockerfiles

parent f9117593
No related branches found
No related tags found
No related merge requests found
-include ./Makefile.config
DOCKERFILE = Dockerfile
SANCUS_DOCKER = sancus-devel
CONTAINER = sancus_cc
FILES = $(realpath ../src)
DOCKERFILE_NODE1 = Node1/Dockerfile
DOCKERFILE_NODE2 = Node2/Dockerfile
DOCKERFILE_SWP = SWP/Dockerfile
SANCUS_DOCKER_NODE1 = sancus-devel-node1
SANCUS_DOCKER_NODE2 = sancus-devel-node2
SANCUS_DOCKER_SWP = sancus-devel-swp
CONTAINER_NODE1 = sancus_cc_node1
CONTAINER_NODE2 = sancus_cc_node2
CONTAINER_SWP = sancus_cc_SWP
FILES = $(realpath ../../src)
all: build run
build:
docker build -t $(SANCUS_DOCKER) --build-arg SANCUS_SECURITY=$(SANCUS_SECURITY) --build-arg SANCUS_KEY=$(SANCUS_KEY) -f $(DOCKERFILE) .
docker build -t $(SANCUS_DOCKER_NODE1) --build-arg SANCUS_SECURITY=$(SANCUS_SECURITY) --build-arg SANCUS_KEY=$(SANCUS_KEY) -f $(DOCKERFILE_NODE1) .
docker build -t $(SANCUS_DOCKER_NODE2) --build-arg SANCUS_SECURITY=$(SANCUS_SECURITY) --build-arg SANCUS_KEY=$(SANCUS_KEY) -f $(DOCKERFILE_NODE2) .
docker build -t $(SANCUS_DOCKER_SWP) --build-arg SANCUS_SECURITY=$(SANCUS_SECURITY) --build-arg SANCUS_KEY=$(SANCUS_KEY) -f $(DOCKERFILE_SWP) .
container:
docker run -i -p 80:80 -t -v '$(FILES):/src' -w /src --name $(CONTAINER) $(SANCUS_DOCKER) /bin/bash
docker run -d --network="host" -v '$(FILES):/src' -w /src --name $(CONTAINER_NODE1) $(SANCUS_DOCKER_NODE1) #/bin/bash
docker run -d --network="host" -v '$(FILES):/src' -w /src --name $(CONTAINER_NODE2) $(SANCUS_DOCKER_NODE2) #/bin/bash
docker run -d --network="host" -v '$(FILES):/src' -w /src --name $(CONTAINER_SWP) $(SANCUS_DOCKER_SWP) #/bin/bash
run:
@echo "Starting container $(CONTAINER)"
......@@ -23,13 +33,29 @@ run:
clean:
@echo "Cleaning up"
@echo -e "[*] removing container '$(CONTAINER)'"
@docker stop $(CONTAINER) 2>/dev/null || true
@docker container rm $(CONTAINER) 2>/dev/null || true
@echo -e "[*] removing container '$(CONTAINER_NODE1)'"
@docker stop $(CONTAINER_NODE1) 2>/dev/null || true
@docker container rm $(CONTAINER_NODE1) 2>/dev/null || true
@echo "Done."
@echo -e "[*] removing container '$(CONTAINER_NODE2)'"
@docker stop $(CONTAINER_NODE2) 2>/dev/null || true
@docker container rm $(CONTAINER_NODE2) 2>/dev/null || true
@echo "Done."
@echo -e "[*] removing container '$(CONTAINER_SWP)'"
@docker stop $(CONTAINER_SWP) 2>/dev/null || true
@docker container rm $(CONTAINER_SWP) 2>/dev/null || true
@echo "Done."
clean-image:
@echo "Cleaning up:"
@echo -e "[*] removing image '$(SANCUS_DOCKER)'"
@docker image rm $(SANCUS_DOCKER) 2>/dev/null || true
@echo -e "[*] removing image '$(SANCUS_DOCKER_NODE1)'"
@docker image rm $(SANCUS_DOCKER_NODE1) 2>/dev/null || true
@echo "Done."
@echo "Cleaning up:"
@echo -e "[*] removing image '$(SANCUS_DOCKER_NODE1)'"
@docker image rm $(SANCUS_DOCKER_NODE2) 2>/dev/null || true
@echo "Done."
@echo "Cleaning up:"
@echo -e "[*] removing image '$(SANCUS_DOCKER_NODE1)'"
@docker image rm $(SANCUS_DOCKER_SWP) 2>/dev/null || true
@echo "Done."
File moved
# Clean Ubuntu 18.04 container
FROM ubuntu:18.04
RUN apt-get update -yqq
RUN apt-get -yqq install build-essential git lsb-release sloccount sudo vim xxd
# Non-interactive
RUN echo "Europe/Brussels" > /etc/timezone
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yqq tzdata
# Config parameters
ARG SANCUS_SECURITY=64
ARG SANCUS_KEY=deadbeefcafebabe
WORKDIR sancus
# Build and install latest Sancus toolchain
RUN git clone https://github.com/sancus-pma/sancus-main.git .
RUN rm Makefile
COPY new_Makefile Makefile
RUN echo "UBUNTU := 1" >> Makefile.config
RUN make install clean \
SANCUS_SECURITY=$SANCUS_SECURITY SANCUS_KEY=$SANCUS_KEY
# Install Webserver
RUN pip3 install flask
# Display a welcome message for interactive sessions
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
>> /etc/bash.bashrc ; echo "\
========================================================================\n\
= Sancus development Docker container =\n\
========================================================================\n\
`lsb_release -d`\n\n\
To get started, see <https://distrinet.cs.kuleuven.be/software/sancus/>,\n\
or have a look at the example programs under </sancus/sancus-examples/>.\n\
\n"\
> /etc/motd
CMD /bin/bash
# Clean Ubuntu 18.04 container
FROM ubuntu:18.04
RUN apt-get update -yqq
RUN apt-get -yqq install build-essential git lsb-release sloccount sudo vim xxd
# Non-interactive
RUN echo "Europe/Brussels" > /etc/timezone
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yqq tzdata
# Config parameters
ARG SANCUS_SECURITY=64
ARG SANCUS_KEY=deadbeefcafebabe
WORKDIR sancus
# Build and install latest Sancus toolchain
RUN git clone https://github.com/sancus-pma/sancus-main.git .
RUN rm Makefile
COPY new_Makefile Makefile
RUN echo "UBUNTU := 1" >> Makefile.config
RUN make install clean \
SANCUS_SECURITY=$SANCUS_SECURITY SANCUS_KEY=$SANCUS_KEY
# Install Webserver
RUN pip3 install flask
# Display a welcome message for interactive sessions
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
>> /etc/bash.bashrc ; echo "\
========================================================================\n\
= Sancus development Docker container =\n\
========================================================================\n\
`lsb_release -d`\n\n\
To get started, see <https://distrinet.cs.kuleuven.be/software/sancus/>,\n\
or have a look at the example programs under </sancus/sancus-examples/>.\n\
\n"\
> /etc/motd
CMD /bin/bash
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment