Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
FROM ubuntu:22.04
LABEL maintainer "pystyle"
FROM ubuntu:22.04 AS builder

ENV LC_ALL C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
build-essential cmake git libboost-all-dev

RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
git \
libboost-all-dev
WORKDIR /app
COPY . .

# Install SSH server
RUN apt-get install -y --no-install-recommends openssh-server && \
echo "root:root" | chpasswd && \
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config
RUN mkdir build && cd build && \
cmake .. && make && make install

RUN rm -rf /var/lib/apt/lists/*
FROM ubuntu:22.04
WORKDIR /app
COPY --from=builder /app/build/install ./install

EXPOSE 22
CMD service ssh start && /bin/bash
EXPOSE 50000
CMD ["./install/bin/nanikiru"]
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,10 @@ Build and run container.

```bash
docker build . --tag mahjong-cpp
docker run -itP --name mahjong-cpp mahjong-cpp
docker run -p 8002:50000 -d --name mahjong-cpp mahjong-cpp
```

Build program on the created container.

```bash
git clone https://github.com/nekobean/mahjong-cpp.git
cd mahjong-cpp
mkdir build && cd build
cmake ..
make -j$(nproc)
make install
```
Container accessible through http://127.0.0.1:8002

## Usage

Expand Down