未验证 提交 3896f772 编写于 作者: Y Yachen 提交者: GitHub

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
上级 7bff6c8b
# 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 \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册