在Docker上使用VSCode是一次艰辛的旅程,它还在继续

使用Docker编译了三种C编译器

VS Code的苦行将继续下去

# code a.c
You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument.

当我使用 –user-data-dir 参数指定了一个替代的用户数据目录时,我无法以 root 权限运行。

–用户数据目录不正确,需要帮助#41429
https://github.com/Microsoft/vscode/issues/41429

# code a.c --user-data-dir /root
/usr/share/code/bin/../code: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

“libasound.so.2:无法打开共享对象文件:没有这个文件或目录。”

增加一个名为下记的图书馆。

# code --version
You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument.
# code a.c --user-data-dir=/root
/usr/share/code/bin/../code: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory
# apt search libsound
Sorting... Done
Full Text Search... Done
libsoundio-dbg/stable 1.0.2-1+b1 amd64
  debugging symbols for libsoundio

libsoundio-dev/stable 1.0.2-1+b1 amd64
  cross platform audio input and output library (development files)

libsoundio1/stable 1.0.2-1+b1 amd64
  cross-platform audio input and output library

libsoundtouch-dev/stable 1.9.2-2+deb9u1 amd64
  Development files for the sound stretching library

libsoundtouch-ocaml/stable 0.1.7-1+b4 amd64
  OCaml bindings for the sound stretching library -- runtime files

libsoundtouch-ocaml-dev/stable 0.1.7-1+b4 amd64
  OCaml bindings for the sound stretching library -- runtime files

libsoundtouch1/stable 1.9.2-2+deb9u1 amd64
  Sound stretching library

libsoundtouch1-dbg/stable 1.9.2-2+deb9u1 amd64
  Debugging symbols for the sound stretching library

root@31acc5c44966:/home/root# apt search libsoundio1
Sorting... Done
Full Text Search... Done
libsoundio1/stable 1.0.2-1+b1 amd64
  cross-platform audio input and output library

root@31acc5c44966:/home/root# apt install libsoundio1

苦修将继续下去。

$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
31acc5c44966        kaizenjapan/cc2     "/bin/bash"         13 hours ago        Up 13 hours                             modest_jackson

$ docker commit 31acc5c44966 kaizenjapan/cc3
sha256:a50dc31ad23fcb73105eac6bd30903517905025af7640f02f261589beb30759c

$ docker push kaizenjapan/cc3
The push refers to repository [docker.io/kaizenjapan/cc3]
189133cb5859: Preparing 
03c403a68abc: Preparing 
67479158abb8: Preparing 
abfd81232d1e: Preparing 
eac885ac1d3b: Preparing 
08e7e0bcc587: Waiting 
0fe19df8b8f8: Waiting 
b17cc31e431b: Waiting 
12cb127eee44: Waiting 
604829a174eb: Waiting 
fbb641a8b943: Waiting 
denied: requested access to the resource is denied

不是CC3而是CC4也是一样的。

参考资料:Docker GCC 升级错误

请参考以下链接获取有关 Docker GCC 升级错误的资讯:
https://qiita.com/kaizen_nagoya/items/d2d424318b711aef4af5

Couldn’t mount the binfmt_misc filesystem
https://qiita.com/kaizen_nagoya/items/da5b0989803b09cac369

获取docker镜像配置时出错:无法获取https://qiita.com/kaizen_nagoya/items/1350d5a7144706d0bd81 上的镜像配置。

删除Docker镜像的步骤

相关文件

为什么C++编译速度较慢?

每个面所需的时间。
很抱歉,没有进行测量。
由于正在将原先用C语言编写的代码改为C++语言,所以即使编译需要花费时间,我也希望执行时间更短。这不仅仅是在优化阶段,还包括之前的阶段,对每个设计都是如此。

使用命令行在VS Code中打开文件或文件夹
https://qiita.com/1natsu172/items/b951aa33451dad36bd7c

Visual Studio Code速查表
https://qiita.com/aoinu/items/681f932ce0b162cd9520

文件历史

版本0.01 初稿 20190505 下午
版本0.02 標題補充 20190505 夕
版本0.03 標題補充 20190813

非常感谢您对此的持续关注。

喜欢的话,请关注我。

非常感谢您阅读至最后一句话。

请按下“喜欢”的图标?并关注我,享受幸福生活。

广告
将在 10 秒后关闭
bannerAds