From 3896f772a3c4555b91e7014f4bc099bae8ac1a3a Mon Sep 17 00:00:00 2001 From: Yachen <43339583+OriPoin@users.noreply.github.com> Date: Wed, 16 Aug 2023 11:56:07 +0800 Subject: [PATCH] Use Ubuntu docker as base image (#234) ### What problem were solved in this pull request? Update Dockerfile Issue Number: #205 Problem: ### What is changed and how it works? 1. Use Ubuntu latest image 2. Use dpes on ubuntu 3. Do not prepare deps when docker compose, because now we have `build.sh init` ### Other information --- docker/Dockerfile | 53 +++++++++++------------------------------------ 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index d31424f..60b2f38 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,59 +1,30 @@ # how to use -# docker build -t miniob . +# use docker build: docker build -t miniob . +# use docker compose: docker compose up -d --build # make sure docker has been installed -# FROM rockylinux:8 -FROM openanolis/anolisos:8.6 +FROM ubuntu:latest ARG HOME_DIR=/root ARG DOCKER_CONFIG_DIR=${HOME_DIR}/docker -ENV LANG=en_US.UTF-8 +# ENV LANG=en_US.UTF-8 +# locale +RUN apt-get update && apt-get install -y locales apt-utils && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +ENV LANG en_US.utf8 -# install rpm -# note: gcc-c++ in rockylinux 8 and gcc-g++ in rockylinux 9. use `dnf groupinfo "Development Tools"` to list the tools -RUN dnf install -y make cmake git wget which flex gdb gcc gcc-c++ diffutils readline-devel texinfo -# rockylinux:9 RUN dnf --enablerepo=crb install -y texinfo -# rockylinux:8 -# RUN dnf --enablerepo=powertools install -y texinfo - -# clone deps and compile deps -# RUN mkdir -p ${HOME_DIR}/deps -WORKDIR ${HOME_DIR}/deps - -RUN git clone https://gitee.com/mirrors/libevent.git -b release-2.1.12-stable \ - && mkdir -p ${HOME_DIR}/deps/libevent/build \ - && cmake -DEVENT__DISABLE_OPENSSL=ON -B ${HOME_DIR}/deps/libevent/build ${HOME_DIR}/deps/libevent \ - && make -C ${HOME_DIR}/deps/libevent/build -j install \ - && rm -rf ${HOME_DIR}/deps/* - -RUN git clone https://gitee.com/mirrors/jsoncpp.git \ - && mkdir -p ${HOME_DIR}/deps/jsoncpp/build \ - && cmake -DJSONCPP_WITH_TESTS=OFF -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF -B ${HOME_DIR}/deps/jsoncpp/build ${HOME_DIR}/deps/jsoncpp/ \ - && make -C ${HOME_DIR}/deps/jsoncpp/build -j install \ - && rm -rf ${HOME_DIR}/deps/* - -RUN git clone https://gitee.com/mirrors/googletest.git \ - && mkdir -p ${HOME_DIR}/deps/googletest/build \ - && cmake -B ${HOME_DIR}/deps/googletest/build ${HOME_DIR}/deps/googletest \ - && make -C ${HOME_DIR}/deps/googletest/build -j install \ - && rm -rf ${HOME_DIR}/deps/* - -RUN wget http://ftp.gnu.org/gnu/bison/bison-3.7.tar.gz \ - && tar xzvf bison-3.7.tar.gz \ - && cd bison-3.7 \ - && ./configure --prefix=/usr/local \ - && make -j install \ - && rm -rf ${HOME_DIR}/deps/* +# dev tools +RUN apt-get update && apt-get install -y build-essential gdb cmake git wget flex texinfo libreadline-dev diffutils bison # install openssh -RUN yum -y install openssh openssh-clients openssh-server +RUN apt-get install -y openssh-server # change root password RUN echo "root:root" | chpasswd RUN mkdir /var/run/sshd # install zsh and on-my-zsh -RUN yum install -y zsh \ +RUN apt-get install -y zsh \ && git clone https://gitee.com/mirrors/ohmyzsh.git ~/.oh-my-zsh \ && cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \ && sed -i "s/robbyrussell/bira/" ~/.zshrc \ -- GitLab