我正在运行centos 7并使用epel包在主机上安装了docker:
yum install epel-release
yum install docker
Run Code Online (Sandbox Code Playgroud)
但码头版本是 - Docker version 0.11.1-dev, build 02d20af/0.11.1
码头的最新稳定分支是1.2
我在这台主机上运行了几个容器,那么如何在这台主机上安全地更新docker?
由于epel repo具有旧包,yum update docker不会更新到最新版本.
这是一个场景,给定一个单词从每个步骤中的单词中删除单个字符,使得缩小的单词仍然是字典中的单词.继续,直到没有人物离开.
这是一个问题:你需要删除正确的字符,例如.总之,可能有两个可能被移除的字符,两者都可能导致缩小的单词成为有效单词,但是在稍后阶段,可能会减少到最后,即没有剩下的字符,而另一个可能挂断.
例:
要么
请参阅我的代码,我使用递归,但想知道是否有更好的有效解决方案来做同样的事情.
public class isMashable
{
static void initiate(String s)
{
mash("", s);
}
static void mash(String prefix, String s)
{
int N = s.length();
String subs = "";
if (!((s.trim()).equals("")))
System.out.println(s);
for (int i = 0 ; i < N ; i++)
{
subs = s.substring(0, i) + s.substring(i+1, N);
if (subs.equals("abc")||subs.equals("bc")||subs.equals("c")||subs.equals("a")) // check in dictionary here
mash("" + s.charAt(i), subs);
}
}
public static void …Run Code Online (Sandbox Code Playgroud) 这是问题所在:
主机具有在不同端口上运行的多个docker应用程序,例如.App1 @ 3001,App2 @ 3002 ... 3100等
现在我想访问该格式的应用http://hostname.com/app1,http://hostname.com/app2 ..
为此,我在主机上运行nginx,以根据子uri将请求代理到正确的端口
location = /app1 {
proxy_redirect http://hostname:3001/;
include /etc/nginx/proxy_params;
}
location ^~ /app1 {
proxy_redirect http://hostname:3001/app1;
include /etc/nginx/proxy_params;
}
Run Code Online (Sandbox Code Playgroud)
但是,当网站的子uri更改或网站重定向时,这不起作用.例如:
If I visit the site at hostname:3001 -> I can see the site
If I visit the site at http://hostname.com/app1 -> I can see the site
If the site page is at hostname:3001/static/index.html then when i access it as http://hostname.com/app1 the page changes to http://hostname.com/static/index.html -> I …Run Code Online (Sandbox Code Playgroud)