-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docker environment for code-server(DON'T MERGE!!!) #500
Draft
Haibarapink
wants to merge
3
commits into
oceanbase:main
Choose a base branch
from
Haibarapink:update-docker-environment
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,53 @@ | ||
# how to use | ||
# use docker build: docker build -t miniob . | ||
# use docker compose: docker compose up -d --build | ||
# make sure docker has been installed | ||
FROM ubuntu:24.04 | ||
FROM linuxserver/code-server:latest | ||
# FROM codercom/code-server:4.21.1 | ||
|
||
ENV LANG en_US.utf8 | ||
RUN apt-get update && apt-get install -y net-tools vim git curl wget iputils-ping gdb | ||
|
||
# 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 | ||
|
||
# # Change sources to Aliyun | ||
# RUN cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak \ | ||
# && echo 'Types: deb' > /etc/apt/sources.list.d/ubuntu.sources \ | ||
# && echo 'URIs: http://mirrors.aliyun.com/ubuntu/' >> /etc/apt/sources.list.d/ubuntu.sources \ | ||
# && echo 'Suites: noble noble-updates noble-security' >> /etc/apt/sources.list.d/ubuntu.sources \ | ||
# && echo 'Components: main restricted universe multiverse' >> /etc/apt/sources.list.d/ubuntu.sources \ | ||
# && echo 'Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg' >> /etc/apt/sources.list.d/ubuntu.sources \ | ||
# && apt-get update | ||
ENV LANG en_US.utf8 | ||
|
||
# dev tools | ||
RUN apt-get update \ | ||
&& apt-get install -y build-essential gdb cmake git wget flex texinfo libreadline-dev diffutils bison \ | ||
&& apt-get install -y clang-format vim sudo | ||
&& apt-get install -y clang-format vim | ||
|
||
# install openssh | ||
RUN apt-get install -y openssh-server | ||
|
||
# Try cloning from GitHub, if it fails, use cnpmjs.org mirror | ||
RUN git clone https://github.com/oceanbase/miniob /tmp/miniob || \ | ||
git clone https://githubfast.com/oceanbase/miniob /tmp/miniob \ | ||
# install clangd | ||
RUN apt-get install -y clangd | ||
|
||
# 更新 code-server 所在的容器中的 PATH 环境变量 | ||
ENV PATH="/usr/bin/gcc:${PATH}" | ||
|
||
# 更新 code-server 所在的容器中的编译器版本 | ||
RUN gcc --version | ||
|
||
# init miniob dependencies | ||
RUN git clone https://github.com/oceanbase/miniob /tmp/miniob \ | ||
&& cd /tmp/miniob \ | ||
&& THIRD_PARTY_INSTALL_PREFIX=/usr/local bash build.sh init \ | ||
&& mkdir -p /root/docker/bin \ | ||
&& touch /etc/.firstrun \ | ||
&& cp docker/bin/* /root/docker/bin/ \ | ||
&& rm -rf /tmp/miniob | ||
|
||
RUN mkdir /var/run/sshd | ||
|
||
# install zsh and on-my-zsh | ||
RUN apt-get install -y zsh \ | ||
&& mkdir ~/.oh-my-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 \ | ||
&& usermod --shell /bin/zsh root \ | ||
&& echo "export LD_LIBRARY_PATH=/usr/local/lib64:\$LD_LIBRARY_PATH" >> ~/.zshrc | ||
|
||
RUN chmod +x /root/docker/bin/* | ||
RUN mkdir -p /root/docker/bin && touch /etc/.firstrun | ||
|
||
WORKDIR /root | ||
# copy starter scripts | ||
COPY bin/* /root/docker/bin/ | ||
|
||
RUN chmod +x /root/docker/bin/* | ||
|
||
ENTRYPOINT /root/docker/bin/starter.sh | ||
RUN apt-get install -y lldb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any other actions needed after
apt-get install
to install and configure plugins in vscode?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because of network reasons, there will be problems when installing the software with the plug-in, so just need to install the software in advance.