S-CORE Docker 环境

Step1: load them into your WSL2 environment by command:

"docker load -i <tar_file>"

复制代码
docker run -it --rm \
  --name persistency_demo \
  --entrypoint /bin/bash \
  vsc-vsps_persistency_demo:latest

启动已停止的容器

docker start -i car_demo

在Docker中

使用 docker0 的 IP 作为代理

export HTTP_PROXY=http://172.17.0.1:3129

export HTTPS_PROXY=http://172.17.0.1:3129

export http_proxy=http://172.17.0.1:3129

export https_proxy=http://172.17.0.1:3129

export NO_PROXY=localhost,127.0.0.1

测试

curl -I https://www.baidu.com

解决方案:配置 apt 使用代理

方法1:临时配置 apt 代理(推荐)

bash

复制代码
# 使用 -o 选项临时指定代理
sudo apt -o Acquire::http::Proxy="http://172.17.0.1:3129" -o Acquire::https::Proxy="http://172.17.0.1:3129" update

方法2:永久配置 apt 代理

bash

复制代码
# 创建 apt 代理配置文件
echo 'Acquire::http::Proxy "http://172.17.0.1:3129";
Acquire::https::Proxy "http://172.17.0.1:3129";' | sudo tee /etc/apt/apt.conf.d/95proxies

# 然后正常使用 apt
sudo apt update

您当前容器正在运行,可以直接使用此命令:

复制代码
# 在宿主机(不是容器内)执行
# 拷贝整个项目目录到容器的 /root 目录
docker cp /home/iiu4sgh/VSPS_GP_0.1.0 car_demo:/root/
car_demo是通过docker ps看出来的

# 或者拷贝当前目录下的项目
docker cp ~/VSPS_GP_0.1.0 car_demo:/root/

拷贝完成后,进入容器即可看到项目:

复制代码
docker start -i car_demo
cd /root/VSPS_GP_0.1.0
bazel build //...

docker cp 常用语法

复制代码
# 拷贝文件到容器
docker cp /主机/文件路径 容器名:/容器/目标路径
相关推荐
写代码的学渣27 分钟前
Linux 彻底清空历史命令 & 恢复历史命令(完整版、重启永久生效)
linux·运维·chrome
生万千欢喜心1 小时前
liunx AnolisOS-8.9-x86_64-dvd.iso win11 适配龙蜥 - 虚拟机
linux
天空'之城2 小时前
Linux 系统编程 12:TCP 进阶
linux·网络编程
红糖奶茶2 小时前
怎么样在遍历列表时动态判断阈值是否被满足并返回相应文本
java·linux·服务器
bkspiderx3 小时前
rpath:Linux 中固定共享库搜索路径的“永久解决方案”
linux·rpath·固定共享库搜索路径
wbs_scy3 小时前
仿 muduo 高并发服务器项目:从 timerfd 到时间轮实现定时任务机制
linux·服务器·c++
AI的探索之旅3 小时前
从 Ubuntu 14.04 到 24.04:TI AM335x 开发环境完整迁移与 Agent 接管方案
linux·数据库·嵌入式硬件·ubuntu·postgresql
阿pin3 小时前
Android随笔-pipe是什么?
android·linux·pipe
小趴菜え3 小时前
升级Ubuntu20.04版本至Ubuntu22.04
linux·运维
辰三3 小时前
统信 UOS + GBase 8s 国产化环境部署实战:从虚拟机到数据库连接完整指南
linux·c#