|
|
|
FROM debian
|
|
|
|
|
|
|
|
# install needed packages
|
|
|
|
RUN apt-get update && \
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
|
|
redis-server \
|
|
|
|
openssh-server \
|
|
|
|
autoconf \
|
|
|
|
bison \
|
|
|
|
bsdmainutils \
|
|
|
|
flex \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
groff \
|
|
|
|
libncursesw5-dev \
|
|
|
|
libsqlite3-dev \
|
|
|
|
make \
|
|
|
|
ncurses-dev \
|
|
|
|
sqlite3 \
|
|
|
|
tar \
|
|
|
|
telnetd \
|
|
|
|
xinetd \
|
|
|
|
locales \
|
|
|
|
git \
|
|
|
|
vim
|
|
|
|
RUN apt-get clean
|
|
|
|
|
|
|
|
# TODO
|
|
|
|
# nightly instructions
|
|
|
|
#
|
|
|
|
RUN git clone https://github.com/NetHack/NetHack.git
|
|
|
|
RUN cd NetHack && \
|
|
|
|
sys/unix/setup.sh sys/unix/hints/linux && \
|
|
|
|
make all
|
|
|
|
RUN find /* -name nethack
|
|
|
|
RUN chmod 777 /NetHack/sys/unix/sysconf
|
|
|
|
|
|
|
|
# make required dirs
|
|
|
|
RUN mkdir -p /redisbackup/
|
|
|
|
|
|
|
|
## update nethack bin location
|
|
|
|
RUN cp /NetHack/src/nethack /bin/nethack
|
|
|
|
RUN chmod 777 /bin/nethack
|
|
|
|
RUN mkdir /hack/
|
|
|
|
|
|
|
|
# update ssh config
|
|
|
|
RUN echo "AllowUsers nethack" >> /etc/ssh/sshd_config
|
|
|
|
RUN echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
|
|
|
|
|
|
|
|
# add hack user
|
|
|
|
RUN useradd nethack -d / -s /nethack-launcher
|
|
|
|
RUN echo 'nethack:U6aMy0wojraho' | chpasswd -e
|
|
|
|
RUN chown -R nethack /hack/
|
|
|
|
|
|
|
|
# build ttyrec
|
|
|
|
RUN git clone https://github.com/ovh/ovh-ttyrec && \
|
|
|
|
cd ovh-ttyrec && \
|
|
|
|
./configure && make && make install
|
|
|
|
|
|
|
|
# remove ttyrec artifacts
|
|
|
|
RUN rm -rf ovh-ttyrec/
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get remove -y\
|
|
|
|
make \
|
|
|
|
git
|
|
|
|
|
|
|
|
# copy in files
|
|
|
|
COPY config.gcfg /
|
|
|
|
COPY nethack-launcher /
|
|
|
|
COPY redis.conf /
|
|
|
|
COPY run.sh /
|
|
|
|
COPY chowner.sh /bin/
|
|
|
|
COPY nethackrc /.nethackrc
|
|
|
|
COPY run_nethack.sh /
|
|
|
|
|
|
|
|
CMD ["/run.sh"]
|