惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
Y
Y Combinator Blog
Recorded Future
Recorded Future
博客园 - Franky
I
InfoQ
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
P
Palo Alto Networks Blog
G
GRAHAM CLULEY
Cloudbric
Cloudbric
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Check Point Blog
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
U
Unit 42
N
Netflix TechBlog - Medium
The Cloudflare Blog
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
T
Troy Hunt's Blog
Engineering at Meta
Engineering at Meta
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
B
Blog
S
Securelist
H
Hacker News: Front Page
Google Online Security Blog
Google Online Security Blog
G
Google Developers Blog

博客园 - 浅蓝

Anaconda c++ Ubuntu18.04安装Tensorflow1.14GPU matplotlib中color可用的颜色 TensorFlow升级到1.13 配置VPN - 浅蓝 Ubuntu16.04 安装Tensorflow1.7过程记录二:安装CUDA及Tensorflow tensorflow 源码编译 Ubuntu16.04 安装Tensorflow1.7过程记录一:安装显卡驱动 深度学习实验记录 ubuntu16.04安装tensorflow1.3 深度学习开源代码链接 如何高效的学习 TensorFlow 代码? 谷歌发布了 T2T(Tensor2Tensor)深度学习开源系统 学习Tensorflow的LSTM的RNN例子 tensorflow nan TensorFlow数据读取 TensorFlow笔记之常见七个参数 tf-slim-mnist
docker
浅蓝 · 2023-02-08 · via 博客园 - 浅蓝

Docker Desktop for Linux and Docker Engine can be installed side-by-side on the same machine. Docker Desktop for Linux stores containers and images in an isolated storage location within a VM and offers controls to restrict its resources. Using a dedicated storage location for Docker Desktop prevents it from interfering with a Docker Engine installation on the same machine.

在home电脑上同时装了Docker Desktop for Linux and Docker Engine ,目前带sudo执行docker命令都是Docker Engine ,否则是Docker Desktop 。(sudo有时候会出现找不到命令,而明明PATH路径下包含该命令,让人疑惑。其实出现这种情况的原因,主要是因为当 sudo以管理权限执行命令的时候,linux将PATH环境变量进行了重置,当然这主要是因为系统安全的考虑,但却使得sudo搜索的路径不是我们想要的PATH变量的路径,当然就找不到我们想要的命令了。)

(Docker Desktop on Linux runs a Virtual Machine (VM) so creates and uses a custom docker context desktop-linux on startup.

This means images and containers deployed on the Linux Docker Engine (before installation) are not available in Docker Desktop for Linux.)

文件位置:(Docker Desktop stores Linux containers and images in a single, large “disk image” file in the Linux filesystem. This is different from Docker on Linux, which usually stores containers and images in the /var/lib/docker directory on the host’s filesystem.

Where is the disk image file?

To locate the disk image file, select Settings from the Docker Dashboard then Advanced from the Resources tab.

The Advanced tab displays the location of the disk image. It also displays the maximum size of the disk image and the actual space the disk image is consuming. Note that other tools might display space usage of the file in terms of the maximum file size, and not the actual file size.) 

docker version 

sudo docker run --rm --runtime=nvidia --gpus all nvidia/cuda:12.0.1-base-ubuntu22.04 nvidia-smi

sudo docker run --name TFG -i -t --runtime=nvidia --gpus all tensorflow/tensorflow:latest-gpu

docker run -it --rm tensorflow/tensorflow    python -c "import tensorflow as tf; print(tf.__version__)"

docker run -it --rm tensorflow/tensorflow:latest-gpu    python -c "import tensorflow as tf; print(tf.__version__)"

sudo docker run -it --name TFG_j --gpus all -p 8888:8888 tensorflow/tensorflow:latest-gpu-jupyter

http://127.0.0.1:8888/?token=537a70e07081f08bf3059d1fa6678acc70024b96cabdf245

stop the Docker Engine service:

sudo systemctl stop docker docker.socket containerd

sudo systemctl start docker docker.socket containerd

 disable the Docker Engine service, and to prevent it from starting automatically:

sudo systemctl disable docker docker.socket containerd

sudo systemctl enable docker docker.socket containerd

switch between Docker Desktop and Docker Engine

docker context ls
docker context use default
docker context use desktop-linux
see the detailed space usage information by running:
docker system df -v

list containers, run:
docker container ls -a
docker ps -a 查看所有容器

启动容器:

sudo docker container start TFG   <name>
交互启动容器:
sudo docker container start -i TFG_j   <name> 
sudo docker container start -i TFG

入容器的shell界面 

  sudo docker attach exciting_cori <name>

If there are lots of redundant objects, run the command:

 docker system prune

适合bind mounts的场景

  • 宿主机和容器共享配置文件。Docker提供的DNS解决方案就是如此,将宿主机的/etc/resolv.conf挂载到每个容器中。
  • 开发环境需要在宿主机和容器中共享代码。docker的开发就是如此,毕竟容器中一般是没有编辑器的
  • When the file or directory structure of the Docker host is guaranteed to be consistent with the bind mounts the containers require.

SRC=/media/...
docker run -it --name tf --mount type=bind,src=${SRC},dst=${SRC} tensorflow/tensorflow

sudo docker run --name TFG -i -t --runtime=nvidia --gpus all --mount type=bind,src=${SRC},dst=${SRC} --mount type=bind,src=${sourceSRC},dst=${sourceSRC} tensorflow/tensorflow:latest-gpu