Check images
docker image list
check your uid/gid
CMD: id johnny
uid=1099(johnny) gid=1099(johnny) groups=1099(johnny),133(docker)
start docker
CMD: docker run -it --name acesetup ace_env:v3 /bin/bash
root@2dac23d862a3:/#
add user
CMD: adduser johnny
finish password setting.
check your uid/gid in docker
CMD: id johnny
uid=1000(johnny) gid=1000(johnny) groups=1000(johnny)
uid/gid is differnet system & docker site. modify in docker container
CMD: usermod -u 1099 johnny
CMD: groupmod -g 1099 johnny
CMD: usermod -aG sudo johnny
exit docker container, and save the modify. (TAG)
CMD: exit
CMD: docker commit -m "add user johnny" abcsetup ace_env:johnny
check image again
CMD: docker image list
update and commit docker
docker start abcenv_ace
docker attach abcenv_ace
mkdir -p /opt/compiler_tool/selinux-3.1/sbin
ln -s /usr/sbin/setfiles /opt/compiler_tool/selinux-3.1/sbin/setfiles
exit
docker commit -m "ln -s /usr/sbin/setfiles /opt/compiler_tool/selinux-3.1/sbin/setfiles" abcenv_ace_env:ace
docker rm abcenv_ace
docker run --name abcenv_ace--privileged -v /extspace:/extspace -it abc_env:ace /bin/bash
docker start abcenv_ace
docker attach abcenv_ace
remove setup container
docker rm abcsetup
update and commit docker
docker start abcenv_ace
docker attach abcenv_ace
apt install python2
ln -s /usr/bin/python2.7 /usr/bin/python
exit
docker commit -m "ln -s /usr/bin/python2.7 /usr/bin/python" abc_env:johnny
docker rm abcenv_ace
docker run --name abcenv_ace--privileged -v /extspace:/extspace -it abc_env:ace /bin/bash
No comments:
Post a Comment