diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f9ded5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config/ayb.toml diff --git a/Dockerfile b/Dockerfile index 09777fb..b128626 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,41 @@ -FROM alpine:latest +FROM rust:1-slim-buster WORKDIR . ENV GIT_REPO https://github.com/marcua/ayb +ENV CHECKOUT main + +RUN apt update +RUN apt install -y \ + build-essential \ + libssl-dev \ + openssl \ + autoconf \ + bison \ + flex \ + gcc \ + g++ \ + git \ + libprotobuf-dev \ + libnl-route-3-dev \ + libtool \ + make \ + pkg-config \ + protobuf-compiler -RUN apk add git clang lld rust cargo openssl openssl-dev RUN git clone $GIT_REPO +# Build nsjail +RUN git clone https://github.com/google/nsjail +RUN cd ./nsjail && make && mv nsjail ../ayb + WORKDIR ./ayb COPY . . RUN git fetch --tags -RUN git checkout $(git describe --tags `git rev-list --tags --max-count=1`) +RUN git checkout $CHECKOUT RUN cargo build --release -RUN echo "#!/bin/sh" >> create_config -RUN echo "[ ! -f ayb.toml ] && cargo run --release -- default_server_config > ayb.toml" >> create_config -RUN chmod +x create_config -RUN /ayb/create_config - -CMD ["cargo", "run", "--release"] +RUN cargo build --release EXPOSE 5433 +CMD ["./target/release/ayb", "server"] diff --git a/README.md b/README.md index 7ce6d57..df1efc2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ # aybDocker Package list available here: [Packages](https://git.sofiaritz.com/sofia/aybDocker/packages) + +## Config file + + +## Isolation + +aybDocker builds `nsjail`. Make sure your `ayb.toml` contains the following + +```toml +[isolation] +nsjail_path = "./nsjail" +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f97abe9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3" +services: + aybServer: + image: git.sofiaritz.com/sofia/ayb:nightly + restart: unless-stopped + volumes: + - ./config/ayb.toml:/ayb/ayb.toml + ports: + - "127.0.0.1:5433:5433"