Skip to content

Commit

Permalink
Docker env set
Browse files Browse the repository at this point in the history
  • Loading branch information
SighingSnow committed Jul 8, 2022
1 parent 0890841 commit d5aaffb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.15)
project(ors)

set(CMAKE_CXX_STANDARD 17)
Expand Down
26 changes: 17 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
ARG JOBS = 2
ARG JOBS=2

FROM dokken/ubuntu-20.04
RUN apt install build-essentials gcc g++ make
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt update && apt install -y gcc g++ make cmake pkg-config \
libfreetype6-dev libavcodec-dev libavformat-dev libswscale-dev libavutil-dev libavdevice-dev \
libxxf86vm-dev libgl1-mesa-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev \
libssl-dev \
xvfb

# Copy source code to docker
COPY . /ors
WORKDIR /ors/build
# Copy source code to docker /ors folder
COPY . /app
WORKDIR /app

# Build and install ors
RUN cmake . && make -j${JOBS} && make install
# Build and make ors
RUN rm -r build && cmake clean . && cmake -B build && cd build && make -j${JOBS}

EXPOSE 8080 8000/udp
# Update work dir
WORKDIR build

#ENTRYPOINT xvfb-run --server-args='-screen 0,1024*768*24'

# Default workdir and command
EXPOSE 8080 8000/udp
Empty file removed docker-compose.yml
Empty file.
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sudo apt install libfreetype6-dev libavcodec-dev libavformat-dev libswscale-dev
Switch to docker branch first.
```shell
docker build -t ors-image
docker run --rm -p 8080:8080 -p 8000:8000/udp ors-image ./build/ors
docker run --rm --name my-ors -p 8080:8080 -p 8000:8000/udp ors-image xvfb-run ./ors
```

### 4 Windows
Expand Down

0 comments on commit d5aaffb

Please sign in to comment.