Skip to content

Commit 9be5d63

Browse files
radaretrufae
authored andcommitted
Update docker image and start scripts
1 parent 6777a51 commit 9be5d63

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

csharp/MainModule.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public class MainModule : NancyModule
55
{
66
public MainModule()
77
{
8-
Get["/"] = x => View["index.html"];
8+
Get["/"] = x => View["index.html"];
99
}
1010
}
1111
/*public class r2warsModule : NancyModule

csharp/Program.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class Program
1414
{
1515
static void Main(string[] args)
1616
{
17-
string httpUrl = "http://127.0.0.1:9664";
18-
string websocketUrl = "ws://127.0.0.1:9966";
17+
string httpUrl = "http://0.0.0.0:9664";
18+
string websocketUrl = "ws://0.0.0.0:9966";
1919
var tokenSource = new CancellationTokenSource();
2020
CancellationToken ct = tokenSource.Token;
2121
if (args.Length > 0) {
@@ -24,7 +24,7 @@ static void Main(string[] args)
2424

2525
var taskA = new Task(() =>
2626
{
27-
var nancyHost = new Nancy.Hosting.Self.NancyHost(new Uri(httpUrl), new CustomBootstrapper());
27+
var nancyHost = new Nancy.Hosting.Self.NancyHost(new Uri("http://0.0.0.0:9664"), new CustomBootstrapper());
2828
nancyHost.Start();
2929
Console.WriteLine("Web server running at " + httpUrl);
3030

docker/Dockerfile

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
FROM mono:latest
22
MAINTAINER @CaptnBanana
33

4-
RUN apt update && apt -y install git build-essential wget
4+
EXPOSE 9664 9966
5+
6+
RUN apt update && apt -y install git build-essential wget screen sudo
57

68
# Get and install r2 from maser
7-
RUN git clone https://github.com/radareorg/radare2 /opt/radare2 && /opt/radare2/sys/install.sh
9+
RUN git clone --depth=1 https://github.com/radareorg/radare2 /opt/radare2 && export CFLAGS=-O2 && /opt/radare2/sys/install.sh
810

911
# Get and compile r2wars from master
10-
RUN git clone https://github.com/radareorg/r2wars.git /opt/r2wars
12+
RUN git clone --depth=1 https://github.com/radareorg/r2wars.git /opt/r2wars
1113
WORKDIR /opt/r2wars/csharp
1214

1315
RUN xbuild /p:Configuration=Release r2wars.csproj
1416

1517
WORKDIR /opt/r2wars/csharp/bin/Release
1618
ENTRYPOINT ["mono", "r2wars.exe"]
19+
# ENTRYPOINT ["bash"]

docker/Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
all:
2+
docker images | grep -q ^r2wars || docker build --no-cache -t r2wars .
3+
sh start.sh
4+
5+
clean:
6+
docker rmi r2wars

docker/start.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# The path to the directory of this file
44
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
55

6-
sudo docker run --rm -it --net=host --name r2wars -v $DIR/warriors:/opt/r2wars/csharp/bin/Release/warriors r2wars
6+
docker run --rm -it -p 9664:9664 -p 9966:9966 --name r2wars -v $DIR/warriors:/opt/r2wars/csharp/bin/Release/warriors r2wars

0 commit comments

Comments
 (0)