在本文中,我们将给您介绍关于DockerUbuntuPATH不会保存的详细内容,并且为您解答dockerubuntudesktop的相关问题,此外,我们还将为您提供关于$path{strlen($pa
在本文中,我们将给您介绍关于Docker Ubuntu PATH 不会保存的详细内容,并且为您解答docker ubuntu desktop的相关问题,此外,我们还将为您提供关于$path {strlen ($path) - 1} == ''/'' || $path.=''/''; 这句是什么意思?、A cycle was detected in the build path of project Build path Build Path Problem(Eclipse)、C# 的 Path.GetFileName、Path.GetExtension、Path.GetDirectoryName千一网络 http://www.itpow.com/、Delphi (Library Path Browsing Path)的知识。
本文目录一览:- Docker Ubuntu PATH 不会保存(docker ubuntu desktop)
- $path {strlen ($path) - 1} == ''/'' || $path.=''/''; 这句是什么意思?
- A cycle was detected in the build path of project Build path Build Path Problem(Eclipse)
- C# 的 Path.GetFileName、Path.GetExtension、Path.GetDirectoryName千一网络 http://www.itpow.com/
- Delphi (Library Path Browsing Path)
Docker Ubuntu PATH 不会保存(docker ubuntu desktop)
如何解决Docker Ubuntu PATH 不会保存
我使用的是 Ubuntu 映像 (Ubuntu 20.04)。从本质上讲,我试图永久修改我的 PATH,这样每次启动容器时,我都不必手动编辑 PATH 来查找我安装的新项目。但是,无论我做什么,我都无法使更改永久化。我已经在图像中投入了相当多的时间,所以我非常想找到一个解决方案,这样我就不必重建整个过程。
这里是外壳信息
#ps -p $$
PID TTY TIME CMD
9 pts/1 00:00:00 sh
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# PATH=$PATH:/kraken
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/kraken
#. ~/.profile
现在当我重新启动容器时:
#echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
基本上,PATH 没有保存。我浏览了很多博客和堆栈,但找不到任何可以坚持的内容。任何帮助将不胜感激。
解决方法
如果您希望容器以预定义的路径开始,您必须编写一个 DockerFile 来描述您的期望。 您可以尝试使用如下所示的 DockerFile:
FROM ubuntu:20.04
COPY kraken /kraken #If you have some content to put in the kraken dir on your Docker instance,use mkdir -p /kraken otherwise
ENV PATH="/kraken:${PATH}"
如果您想为以后的容器保留该值,则在运行时直接在容器中更改路径不是解决方案。 Docker 容器被设计为具有短暂性和可扩展性。
$path {strlen ($path) - 1} == ''/'' || $path.=''/''; 这句是什么意思?
OSC 请你来轰趴啦!1028 苏州源创会,一起寻宝 AI 时代
$path {strlen ($path) - 1} == ''/'' || $path.=''/''; 这句左边 $path {strlen ($path) - 1} 是什么意思?
A cycle was detected in the build path of project Build path Build Path Problem(Eclipse)
解决:window--preferences--java--Compiler--Building--Build path problems--circular dependencies 由 error 改成 warning 并应用,问题解决。
C# 的 Path.GetFileName、Path.GetExtension、Path.GetDirectoryName千一网络 http://www.itpow.com/
http://www.itpow.com/ 千一网络
Path.GetFileName
string s2 = Path.GetFileName("D:\\dir\\asp.net\\readme."); // readme.
string s3 = Path.GetFileName("D:\\dir\\asp.net\\readme"); // readme
string s4 = Path.GetFileName("D:\\dir\\asp.net\\readme\\"); // 零长度字符串
string s5 = Path.GetFileName("D:\\"); // 零长度字符串
string s6 = Path.GetFileName("D:"); // 零长度字符串
说明:路径中的 \ 和 / 是一样的结果。
只要不是以 \ 或 / 结束,都是当作文件对待(盘符除外)。
Path.GetExtension
string s1 = Path.GetExtension("D:\\dir\\asp.net\\readme.txt"); // .txtstring s2 = Path.GetExtension("D:\\dir\\asp.net\\readme."); // 零长度字符串
string s3 = Path.GetExtension("D:\\dir\\asp.net\\readme"); // 零长度字符串
string s4 = Path.GetExtension("D:\\dir\\asp.net\\readme\\"); // 零长度字符串
string s5 = Path.GetExtension("D:\\"); // 零长度字符串
string s6 = Path.GetExtension("D:"); // 零长度字符串
Path.GetDirectoryName
string s1 = Path.GetDirectoryName("D:\\dir\\asp.net/readme.txt"); // D:\dir\asp.netstring s2 = Path.GetDirectoryName("D:\\dir\\asp.net/readme."); // D:\dir\asp.net
string s3 = Path.GetDirectoryName("D:\\dir\\asp.net/readme"); // D:\dir\asp.net
string s4 = Path.GetDirectoryName("D:\\dir\\asp.net/readme/"); // D:\dir\asp.net\readme
string s5 = Path.GetDirectoryName("D:\\"); // null,注意是 null
string s6 = Path.GetDirectoryName("D:"); // null,注意是 null
这里,我们故意在路径中使用“/”,可以发现最终还是会转换成“\”。
原文连接:http://www.cftea.com/c/2017/02/6812.asp
Delphi (Library Path Browsing Path)
首先要明白的一个概念是dcu文件
*.dcu是*.pas的编译后单元文件(Delphi Compiled Unit), 编译器把它和库文件连接起来就构成了可执行文件*.exe 或*.dll等,相当于C中的obj文件。
你所说的AgentObjects_TLB.dcu文件不一定在你的机器存在过它很可能是被编进
*.bpl库文件中的,不是单独存在的,IDE环境下出错后有时不报*.bpl,而是报它的组成部分。
编译时,源文件没有修改过的,就不会再次编译,直接调用dcu文件。所以有些第三方组件为了保护代码,就不提供pas文件,值提供dcu,也可以运行。
但是如果和别的单元有依赖性,就需要重新编译了,需要pas文件。
所以Library Path设置的就是编译器查找源文件或dcu编译文件的路径
如果没有dcu,则编译pas文件生成之;如果有dcu,又不是build则直接拿dcu来连接
(在注册表中Library Path的名称为search path; 而Project-option里面也有一个search path,很搞是吧, 那个search path是项目级别的搜索路径,而前一个是系统级别的)
那么browsing path是设置什么的呢?
它是设置代码浏览器查找源代码的路径, 不设这个路径不影响运行。
但它还有另外一个目的:http://www.delphibbs.com/delphibbs/dispq.asp?lid=995504讲了这个。
我们以raize组件为例
Library Path为D:\Program Files\Borland\Component\Raize.v4.02\RC4\Lib\Delphi7
里面没有pas文件,只有dfm和dcu文件
Browsing Path为:D:\Program Files\Borland\Component\Raize.v4.02\RC4\Source
里面有所有dfm,pas,dpk文件,但没有dcu
很清楚这样做的目的是保护pas文件被意外修改后, 不会编译, 不会影响到dcu文件; 但又能自由浏览调试源文件。
Raize的bin目录是存放bpl文件的,里面有两个设计时包, 这是IDE中Known packages用到的
还有一个System32子目录,里面还有两个包,这是运行时包,复制到系统目录下。
同样delphi自身的组织也是这样
Lib目录里面都是dcu,没有源代码
Imports目录里面是导入的空间的dcu
Bin目录中都是bpl,dll,exe
Projects\Bpl中都是自己编译的第三方组件生成的bpl
Source目录中都是pas文件,分为多个目录组织
所以如果要修改delphi源代码(当然不鼓励这样做), 先要把pas拷到Lib目录中,生成新的dcu,覆盖掉老的,如:
http://www.delphibbs.com/delphibbs/dispq.asp?lid=404099
DELPHI怎么跟踪进VCL库文件里或者第三方控件的单元里?
http://www.delphibbs.com/delphibbs/dispq.asp?lid=2071839
如何制作控件安装程序
http://www.delphibbs.com/delphibbs/dispq.asp?lid=2053286
我们今天的关于Docker Ubuntu PATH 不会保存和docker ubuntu desktop的分享已经告一段落,感谢您的关注,如果您想了解更多关于$path {strlen ($path) - 1} == ''/'' || $path.=''/''; 这句是什么意思?、A cycle was detected in the build path of project Build path Build Path Problem(Eclipse)、C# 的 Path.GetFileName、Path.GetExtension、Path.GetDirectoryName千一网络 http://www.itpow.com/、Delphi (Library Path Browsing Path)的相关信息,请在本站查询。
本文标签: