未验证 提交 a9ce517a 编写于 作者: 羽飞's avatar 羽飞 提交者: GitHub

update docker (#245)

### What problem were solved in this pull request?

Issue Number: ref #205 

Problem:
The build method is different with the current docker image, so we need
to update it.

### What is changed and how it works?
Install build tools and dependencies when building image.
上级 fa6e5c7f
...@@ -19,6 +19,12 @@ RUN apt-get update && apt-get install -y build-essential gdb cmake git wget flex ...@@ -19,6 +19,12 @@ RUN apt-get update && apt-get install -y build-essential gdb cmake git wget flex
# install openssh # install openssh
RUN apt-get install -y openssh-server RUN apt-get install -y openssh-server
# init miniob dependencies
RUN git clone https://github.com/oceanbase/miniob /tmp/miniob \
&& cd /tmp/miniob \
&& bash build.sh init \
&& rm -rf /tmp/miniob
# change root password # change root password
RUN echo "root:root" | chpasswd RUN echo "root:root" | chpasswd
RUN mkdir /var/run/sshd RUN mkdir /var/run/sshd
...@@ -32,13 +38,9 @@ RUN apt-get install -y zsh \ ...@@ -32,13 +38,9 @@ RUN apt-get install -y zsh \
&& echo "export LD_LIBRARY_PATH=/usr/local/lib64:\$LD_LIBRARY_PATH" >> ~/.zshrc && echo "export LD_LIBRARY_PATH=/usr/local/lib64:\$LD_LIBRARY_PATH" >> ~/.zshrc
RUN mkdir -p ${DOCKER_CONFIG_DIR}/bin RUN mkdir -p ${DOCKER_CONFIG_DIR}/bin
RUN mkdir -p ${DOCKER_CONFIG_DIR}/config
WORKDIR ${DOCKER_CONFIG_DIR}/bin WORKDIR ${DOCKER_CONFIG_DIR}/bin
# copy vscode config files
COPY config/* ${DOCKER_CONFIG_DIR}/config/
# copy starter scripts # copy starter scripts
COPY bin/* ${DOCKER_CONFIG_DIR}/bin/ COPY bin/* ${DOCKER_CONFIG_DIR}/bin/
......
# 构建
docker-compose build
# 启动容器
docker-compose up -d
-d 表示后台启动
# 进入容器
docker exec -it miniob bash
...@@ -61,19 +61,3 @@ else ...@@ -61,19 +61,3 @@ else
git clone $REPO_ADDR ${REPO_DIR} git clone $REPO_ADDR ${REPO_DIR}
fi fi
if [ ! -d "${REPO_DIR}/bin" ]; then
mkdir -p ${REPO_DIR}/build
fi
# vscode config
if [ ! -d "${REPO_DIR}/.vscode" ]; then
mkdir -p ${REPO_DIR}/.vscode
fi
if [ ! -f "${REPO_DIR}/.vscode/launch.json" ]; then
cp /root/docker/config/launch.json ${REPO_DIR}/.vscode/launch.json
fi
if [ ! -f "${REPO_DIR}/.vscode/tasks.json" ]; then
cp /root/docker/config/tasks.json ${REPO_DIR}/.vscode/tasks.json
fi
...@@ -5,6 +5,6 @@ HOST_KEY_DIR=/etc/ssh/ssh_host_rsa_key ...@@ -5,6 +5,6 @@ HOST_KEY_DIR=/etc/ssh/ssh_host_rsa_key
if [ ! -f "${HOST_KEY_DIR}" ]; then if [ ! -f "${HOST_KEY_DIR}" ]; then
ssh-keygen -A ssh-keygen -A
fi fi
/usr/sbin/sshd -D /usr/sbin/sshd
echo sshd started! echo sshd started!
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bin/observer",
"args": ["-f", "${workspaceFolder}/etc/observer.ini"],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "CMake Build"
}
]
}
\ No newline at end of file
{
"options": {
"cwd": "${workspaceFolder}/build"
},
"tasks": [
{
"label": "cmake",
"command": "cmake",
"args": [
"-DDEBUG=ON",
".."
]
},
{
"label": "make",
"command": "make",
"args": [
"-j",
"6"
]
},
{
"label": "CMake Build",
"dependsOn": [
"cmake",
"make"
]
}
],
"version": "2.0.0"
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ services: ...@@ -4,7 +4,7 @@ services:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
image: miniob:v1.0 image: miniob:v1.1
container_name: miniob container_name: miniob
privileged: true privileged: true
ports: ports:
......
...@@ -21,13 +21,11 @@ See the Mulan PSL v2 for more details. */ ...@@ -21,13 +21,11 @@ See the Mulan PSL v2 for more details. */
#include "sql/stmt/stmt.h" #include "sql/stmt/stmt.h"
#include "sql/expr/expression.h" #include "sql/expr/expression.h"
class FieldMeta;
class FilterStmt;
class Db; class Db;
class Table; class Table;
/** /**
* @brief 表示select语句 * @brief 描述算术运算语句
* @ingroup Statement * @ingroup Statement
*/ */
class CalcStmt : public Stmt class CalcStmt : public Stmt
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册