目录
1.加载镜像并进入容器
sudo docker run -it ubuntu bash
mkdir app //建立app目录
//换源
sed -i 's/http:\/\/archive.ubuntu.com\/ubuntu\//http:\/\/mirrors.aliyun.com\/ubuntu\//g' /etc/apt/sources.list
echo "nameserver 8.8.8.8" > /etc/resolv.conf
apt-get update \
????&& apt-get install build-essential libglib2.0-dev cmake \
????&& apt-get install default-jdk python-all-dev liblua5.1-dev golang doxygen
?
git clone https://github.com/lcm-proj/lcm.git
docker cp /home/f**/lcm?87d:/app??//87d是创建容器生成的ID号
cd lcm
vim /etc/profuile
在最后一行添加
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
source /etc/profile
cmake ..
make
make install
以上步骤将环境都安装完成了
docker cp /home/fuzhifang/LCM?87d:/app??//87d是创建容器生成的ID号
LCM是可执行文件
cd /app/LCM
lcm-gen -x example_t.lcm
g++ -o send_message send_message.cpp -llcm
g++ -o listener listener.cpp -llcm
mkdir build
cd build
cmake ..
make
sudo docker exec -it 87d bash
cd /app/LCM/build
终端1 ./lister 终端2 ./send_message
退出镜像exit
提交容器
docker commit 87df17537bc4 mylcm:v11
查看镜像
导出压缩包
docker save -o lcm_images0108.tar mylcm:v11