Dockerfile 1.4 KB
Newer Older
羽飞's avatar
docker  
羽飞 已提交
1
# how to use
Y
Yachen 已提交
2 3
# use docker build: docker build -t miniob .
# use docker compose: docker compose up -d --build
羽飞's avatar
docker  
羽飞 已提交
4
# make sure docker has been installed
Y
Yachen 已提交
5
FROM ubuntu:latest
羽飞's avatar
羽飞 已提交
6 7

ARG HOME_DIR=/root
8
ARG DOCKER_CONFIG_DIR=${HOME_DIR}/docker
羽飞's avatar
羽飞 已提交
9

Y
Yachen 已提交
10 11 12 13 14
# 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
羽飞's avatar
羽飞 已提交
15

Y
Yachen 已提交
16 17
# dev tools
RUN apt-get update && apt-get install -y build-essential gdb cmake git wget flex texinfo libreadline-dev diffutils bison
羽飞's avatar
羽飞 已提交
18

19
# install openssh
Y
Yachen 已提交
20
RUN apt-get install -y openssh-server
21

羽飞's avatar
羽飞 已提交
22 23 24 25 26 27
# init miniob dependencies
RUN git clone https://github.com/oceanbase/miniob /tmp/miniob \
    && cd /tmp/miniob \
    && bash build.sh init \
    && rm -rf /tmp/miniob

28 29 30 31 32
# change root password
RUN echo "root:root" | chpasswd
RUN mkdir /var/run/sshd

# install zsh and on-my-zsh
Y
Yachen 已提交
33
RUN apt-get install -y zsh \
34 35 36 37 38 39 40 41 42 43 44 45
    && 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 \
    && usermod --shell /bin/zsh root \
    && echo "export LD_LIBRARY_PATH=/usr/local/lib64:\$LD_LIBRARY_PATH" >> ~/.zshrc

RUN mkdir -p ${DOCKER_CONFIG_DIR}/bin

WORKDIR ${DOCKER_CONFIG_DIR}/bin

# copy starter scripts
COPY bin/* ${DOCKER_CONFIG_DIR}/bin/
羽飞's avatar
羽飞 已提交
46

47
RUN chmod +x ${DOCKER_CONFIG_DIR}/bin/*
羽飞's avatar
羽飞 已提交
48

羽飞's avatar
羽飞 已提交
49
ENTRYPOINT ./starter.sh