把docker容器中的环境变量文件拷贝到主机上
41e260ab9035为docker容器ID
docker cp 41e260ab9035:/etc/profile profile
vi profile
在profile文件最后添加上下面的内容:
MAVEN_HOME=/usr/share/maven
PATH=$MAVEN_HOME/bin:$PATH
export MAVEN_HOME PATH
把修改好的文件复制回容器
docker cp profile 41e260ab9035:/etc/profile
进入 docker容器中
docker exec -it 41e260ab9035 /bin/bash
source /etc/profile