FROM debian:stable-slim # install needed packages RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ openssh-server \ autoconf \ bison \ bsdmainutils \ bzip2 \ flex \ gcc \ gdb \ git \ groff \ libncursesw5-dev \ libsqlite3-dev \ libboost-all-dev \ libncurses5-dev \ libncursesw5-dev \ lua5.1 \ liblua5.1-0-dev \ libsdl2-dev \ libsdl2-image-2.0-0 \ libsdl2-mixer-2.0-0 \ libsdl2-image-dev \ libxerces-c-dev \ make \ ncurses-dev \ premake4 \ sqlite3 \ redis-server \ tar \ telnetd \ xinetd \ locales \ wget \ vim RUN apt-get clean # TODO # nightly instructions # RUN git clone https://github.com/NetHack/NetHack.git RUN cd NetHack && \ git checkout NetHack-3.6 && \ sed -i 's/#ifndef SYSCF/#ifdef SYSCF/g' include/config.h && \ sys/unix/setup.sh sys/unix/hints/linux && \ sed -i '/POSTINSTALL=/d' Makefile && \ sed -i 's/.*-DSYSCF -DSYSCF_FILE=.*/CFLAGS+=-DSECURE/' Makefile && \ sed -i 's/#CFLAGS+=-DSCORE_ON_BOTL/CFLAGS+=-DSCORE_ON_BOTL/' Makefile && \ cat Makefile && \ make all && \ make install RUN find /* -name nethack RUN chmod 777 /NetHack/sys/unix/sysconf # update sysconf RUN sed -i 's/.*WIZARDS=.*/#WIZARDS=/' /NetHack/sys/unix/sysconf RUN sed -i 's/.*GENERICUSERS=.*/#GENERICUSERS=/' /NetHack/sys/unix/sysconf RUN sed -i 's/.*MAXPLAYERS=.*/MAXPLAYERS=0/' /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/ RUN chown -R nethack /NetHack/ RUN touch /.hushlogin # 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 \ autoconf \ bison \ bsdmainutils \ flex \ groff # build reclist COPY reclist.c / RUN gcc reclist.c -o /bin/reclist RUN rm reclist.c # 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 / COPY link_sotw.sh /bin/ COPY clean.sh /bin/ ADD sotw.tar.gz / RUN mv /shadow-of-the-wyrm* /sotw/ COPY scores.dat /sotw/ # update ini to match current season by default RUN cd /sotw && \ sed -i 's/current_month_is_start_month=0/current_month_is_start_month=1/g' swyrm.ini CMD ["/run.sh"]