S2OJ/install/bundle/Dockerfile
Masco Skray 47320c8758 fix(install/bundle): mysqld cannot start due to overlayfs of docker
This is an old enough bug while using MySQL version 5.5 with Ubuntu 14.04.
According to these issues form docker or moby repository:
https://github.com/docker/for-linux/issues/72
https://github.com/moby/moby/issues/35503
overlayfs only supports a subset of the POSIX standard.
But the problem does not arise when using aufs.
We do a little trick to MAKE MYSQL GREAT AGAIN.

NOTICE: Only people who are using docker may face this problem.
If you are using a bare-metal system or just running a virtual machine,
executing the installation script without using container works fine.
2018-10-10 23:50:50 +08:00

25 lines
840 B
Docker

FROM ubuntu:18.04
MAINTAINER MascoSkray <MascoSkray@gmail.com>
#Update apt and install git
RUN apt-get update && apt-get install -y git gnupg
#Clone the latest UOJ Community verison to local
RUN cd ~ && git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1 -b php7
#Install environment and set startup script
RUN cd ~/UOJ-System/install/bundle && bash install.sh -e && echo "\
#!/bin/bash\n\
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld\n\
if [ ! -f \"/var/svn/.UOJSetupDone\" ]; then\n\
cd ~/UOJ-System/install/bundle && bash install.sh -c\n\
fi\n\
service ntp start\n\
service mysql start\n\
service apache2 start\n\
svnserve -d -r /var/svn\n\
su local_main_judger -c \"~/judge_client/judge_client start\"\n\
exec bash\n" >/root/up && chmod +x /root/up
ENV LANG=C.UTF-8 TZ=Asia/Shanghai
EXPOSE 80 3690
CMD /root/up