bash - 来自守护进程的错误响应:当我尝试在容器内提交更改时未能获得摘要:第 1 部分
问题描述
我想设置一个脚本,将更改提交到 docker 映像。我正在学习如何阅读这篇文章:
我做了一些修改以使其适合我的场景。
这是我的“env_setup_script.sh”脚本:
开始.sh:
#!/bin/bash
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
sudo service docker start
hostusername=$(whoami)
echo -n " Hello, whats your name ?"
read -r
username=$REPLY
docker run \
--gpus all \
--rm -it \
-v $XSOCK:$XSOCK:rw \
-v $XAUTH:$XAUTH:rw \
-e DISPLAY=$DISPLAY \
-e XAUTHORITY=$XAUTH \
-v /:/home/$username/Shared-$hostusername \
-t firefox/docker
根据帖子,这是我的:
提交.sh:
#!/bin/bash
# Run a docker with the env boot script
./start.sh
# Get the container ID of the last run docker (above)
export CONTAINER_ID=\docker ps -lq``
echo $CONTAINER_ID
# Commit the container state (returns an image_id with sha256: prefix cut off)# and write the IMAGE_ID to disk at ~/.docker_image_id
(docker commit $CONTAINER_ID | cut -c8-) > docker_image_id
不幸的是它不起作用:
# ./commit.sh
Hello, whats your name ? mario
# apt install geditReading package lists... DoneBuilding dependency tree Reading state information... Done
The following additional packages will be installed: gedit-common gir1.2-gtksource-4 gir1.2-peas-1.0 libamtk-5-0 libamtk-5-common libgspell-1-2 libgspell-1-common libgtksourceview-4-0 libgtksourceview-4-common libpeas-1.0-0 libpeas-common libtepl-4-0 python3-gi-cairoSuggested packages: gedit-pluginsThe following NEW packages will be installed: gedit gedit-common gir1.2-gtksource-4 gir1.2-peas-1.0 libamtk-5-0 libamtk-5-common libgspell-1-2 libgspell-1-common libgtksourceview-4-0 libgtksourceview-4-common libpeas-1.0-0 libpeas-common libtepl-4-0 python3-gi-cairo0 upgraded, 14 newly installed, 0 to remove and 7 not upgraded.Need to get 1218 kB of archives.After this operation, 9606 kB of additional disk space will be used.Do you want to continue? [Y/n] y
.....
root@c52cc7395c5d:/# exitexit
84bf2f08ac45
Error response from daemon: failed to get digest
sha256:f749b9fd92b430df6783496eaa814c63bd06a7cb5a5914611f10b8f665a5d134: open /var/lib/docker/image/overlay2/imagedb/content/sha256/f749b9fd92b430df6783496eaa814c63bd06a7cb5a5914611f10b8f665a5d134: no such file or directory
解决方案
推荐阅读
- three.js - 删除three.js中的“纹理已调整大小”控制台日志
- sql-server - 创建 CLUSTERED INDEX 分区后查询数据缓慢 [Azure]
- python - perisan 404中的Django slug url
- c++ - C ++中的Sublime Text 3错误,如何解决?
- android - Google Play 服务和地图存在更新和兼容性问题
- python - from google.protobuf.pyext import _message ImportError: DLL load failed: 找不到指定的程序
- c - 如何在函数中返回三个数字而不使用 C 中的数组或指针?
- swift4 - 使用 HotspotHelper 扫描可用的 wifi
- windows - 如何从其他设备访问 Google Cloud Platform 上自己的本地主机
- html - 点击时 Ionic 3 展开标题