在autoware.auto + lgsvl仿真使用时,发现docker更新后无法进入ade,为了对ade有更透彻的理解,学习ade官网并做笔记如下:
官网地址:
Introduction — ADE 4.4.0dev documentation![]()
讯享网https://ade-cli.readthedocs.io/en/latest/intro.html
1. ADE 从一个基础镜像创建一个容器,同时在/opt目录下挂载其他只读的卷。 基础镜像提供开发工具。其他的卷提供额外的开发工具(IDE,大型第三方库等)或者已发布的软件版本(如最新的autoware 发布版本),同时,ADE能够很容易的切换不同的镜像和卷。
从此来看,autoware.atuo的ade架构如下:
registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/ade-foxy:master
为生成容器的基础镜像
registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/binary-foxy:master
registry.gitlab.com/autowarefoundation/autoware.auto/ade-lgsvl/foxy:2021.3

为两个只读卷挂载在基础镜像下
2, 遇到的问题为:
autoware 容器中改变了一些东西,想要保存到镜像。但是使用 docker commit 命令保存镜像之后,运行镜像会出现错误 useradd :user “*” already exitst。解决方法如下:
[autoware.auto] How to make apt packages persist in ADE? - ROS Answers: Open Source Q&A ForumIf I'm working in ADE and I use apt to install something that is not already included, how can I make sure that what I install sticks around after I stop ADE? At the moment, I am having to re-install everything every time I stop and restart ADE. I'm sure it's something simple and I tried looking through documentation for Docker, but I don't know enough about how it works to really know what to look for.
https://answers.ros.org/question//autowareauto-how-to-make-apt-packages-persist-in-ade/经过测试,上面的方法无效.....,重新寻找方法
最近在项目中使用ade,找到了可以commit镜像修改并正常使用的方法,原因其实就是commit之后镜像里会保留当前用户,再次进入时ade_entrypoint 要增加当前用户,所以有冲突,修改该ade_entrypoint,如下,当发现镜像时有当前用户时不删除。
#!/usr/bin/env bash # # Copyright 2017 - 2018 Ternaris # SPDX-License-Identifier: Apache 2.0 set -e if [[ -n "$GITLAB_CI" ]]; then exec "$@" fi if [[ -n "$DEBUG" ]]; then set -x fi if [[ -n "$TIMEZONE" ]]; then echo "$TIMEZONE" > /etc/timezone ln -sf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime dpkg-reconfigure -f noninteractive tzdata fi user=$(awk -F: '$3=='$USER_ID'{print $1}' /etc/passwd) if [ -n "$user" ]; then echo "found user: ["$user"] with user_id ["$USER_ID"]" if [ "$user" != "$USER" ]; then echo "now try to delete user [$user]" userdel -rf $user if [ $? -eq 0 ]; then echo "delete [$user] successful" groupdel "$GROUP" &>/dev/null || true groupadd -og "$GROUP_ID" "$GROUP" useradd -M -u "$USER_ID" -g "$GROUP_ID" -d "/home/$USER" -s /bin/bash "$USER" groupdel video &> /dev/null || true groupadd -og "${VIDEO_GROUP_ID}" video gpasswd -a "${USER}" video else echo "delete [$user] failure" fi else echo "the user is same as USER, do not delete user" fi else echo "do not found user with user_id ["$USER_ID"], add user" groupdel "$GROUP" &>/dev/null || true groupadd -og "$GROUP_ID" "$GROUP" useradd -M -u "$USER_ID" -g "$GROUP_ID" -d "/home/$USER" -s /bin/bash "$USER" groupdel video &> /dev/null || true groupadd -og "${VIDEO_GROUP_ID}" video gpasswd -a "${USER}" video fi for x in /etc/skel/.*; do target="/home/$USER/$(basename "$x")" if [[ ! -e "$target" ]]; then cp -a "$x" "$target" chown -R "$USER":"$GROUP" "$target" fi done if [[ -z "$SKIP_ADEINIT" ]]; then for x in /opt/*; do if [[ -x "$x/.adeinit" ]]; then echo "Initializing $x" sudo -Hu "$USER" -- bash -lc "$x/.adeinit" echo "Initializing $x done" fi done fi echo 'ADE startup completed.' exec "$@"
讯享网
问题解决,binggo!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/24476.html