Docker Note

1 Intall docker in Unbuntu 14.01 LTS:

sudo apt-get install docker.io


2 Docker file structure:

Base Image- Image - Repository(App)


3. Install docker in CentOS 7:

yum -y install docker-io              (install docker)

service docker start           (launch docker)

chkconfig dockker on       (add into auto-launch with the bootup of system)


docker images                                  #查看已下载的镜像

docker run -i -t centos /bin/bash              #启动一个容器

docker imr image_id                            #删除镜像

docker rmi $(docker images | grep none | awk '{print $3}' | sort -r)  #删除所有镜像

docker ps -a                                  #查看所有容器(包括正在运行和已停止的)

docker start container                        #开启一个容器(注意container_id和image_id是完全不一样de)

docker logs <容器名orID> 2>&1 | grep '^User: ' | tail -n1 #查看容器的root用户密码,因为docker容器启动时的root用户的密码是随机分配的。所以,通过这种方式就可以得到redmine容器的root用户的密码了

docker logs -f <容器名orID>                    #查看容器日志

docker rm $(docker ps -a -q)                    #删除所有容&删除单个容器docker rm <容器名orID>

docker run --name redmine -p 9003:80 -p 9023:22 -d -v /var/redmine/files:/redmine/files -v    /var/redmine/mysql:/var/lib/mysql sameersbn/redmine

#运行一个新容器,同时为它命名、端口映射、文件夹映射。以redmine镜像为例

docker

 run -i -t --name sonar -d -link mmysql:db  tpires/sonar-server

 # 一个容器连接到另一个容器&sonar容器连接到mmysql容器,并将mmysql容器重命名为db。这样,sonar容器就可以使用

db的相关的环境变量了。

#当需要把一台机器上的镜像迁移到另一台机器的时候,需要保存镜像与加载镜像。

机器a

docker save busybox-1 > /home/save.tar

使用scp将save.tar拷到机器b上,然后:

docker load < /home/save.tar

docker build -t <镜像名> <Dockerfile路径>        #构建自己的镜像


4. Docker exit virtual terminal

运行交互性的shell(就像运行一个单独的linux)

# 使用ubuntu运行一个交互性的shell,
# 分配一个伪终端,附带stdin和stdout(输入/输出流)
# 如果你想退出分离出来的伪终端,
# 可以使用CTRL -p+CTRL -q --就像先按CTRL -p 然后CTRL -q
sudo docker run -i -t ubuntu /bin/bash


这是他的npm信息 Filesystem MCP Server Node.js server implementing Model Context Protocol (MCP) for filesystem operations. Features Read/write files Create/list/delete directories Move files/directories Search files Get file metadata Note: The server will only allow operations within directories specified via args. API Resources file://system: File system operations interface Tools read_file Read complete contents of a file Input: path (string) Reads complete file contents with UTF-8 encoding read_multiple_files Read multiple files simultaneously Input: paths (string[]) Failed reads won't stop the entire operation write_file Create new file or overwrite existing (exercise caution with this) Inputs: path (string): File location content (string): File content edit_file Make selective edits using advanced pattern matching and formatting Features: Line-based and multi-line content matching Whitespace normalization with indentation preservation Multiple simultaneous edits with correct positioning Indentation style detection and preservation Git-style diff output with context Preview changes with dry run mode Inputs: path (string): File to edit edits (array): List of edit operations oldText (string): Text to search for (can be substring) newText (string): Text to replace with dryRun (boolean): Preview changes without applying (default: false) Returns detailed diff and match information for dry runs, otherwise applies changes Best Practice: Always use dryRun first to preview changes before applying them create_directory Create new directory or ensure it exists Input: path (string) Creates parent directories if needed Succeeds silently if directory exists list_directory List directory contents with [FILE] or [DIR] prefixes Input: path (string) move_file Move or rename files and directories Inputs: source (string) destination (string) Fails if destination exists search_files Recursively search for files/directories Inputs: path (string): Starting directory pattern (string): Search pattern excludePatterns (string[]): Exclude any patterns. Glob formats are supported. Case-insensitive matching Returns full paths to matches get_file_info Get detailed file/directory metadata Input: path (string) Returns: Size Creation time Modified time Access time Type (file/directory) Permissions list_allowed_directories List all directories the server is allowed to access No input required Returns: Directories that this server can read/write from Usage with Claude Desktop Add this to your claude_desktop_config.json: Note: you can provide sandboxed directories to the server by mounting them to /projects. Adding the ro flag will make the directory readonly by the server. Docker Note: all directories must be mounted to /projects by default. { "mcpServers": { "filesystem": { "command": "docker", "args": [ "run", "-i", "--rm", "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop", "--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro", "--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt", "mcp/filesystem", "/projects" ] } } } NPX { "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/username/Desktop", "/path/to/other/allowed/dir" ] } } } Build Docker build: docker build -t mcp/filesystem -f src/filesystem/Dockerfile . License This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. Readme Keywords none
最新发布
06-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值