在昨天有关Shocker的消息之后,似乎Docker容器中的应用程序不应该以root身份运行.我试图更新我Dockerfile
创建一个应用程序用户,但是更改应用程序文件的权限(虽然仍然是root)似乎不起作用.我猜这是因为某些LXC权限未被授予root用户可能吗?
这是我的Dockerfile:
# Node.js app Docker file
FROM dockerfile/nodejs
MAINTAINER Thom Nichols "thom@thomnichols.org"
RUN useradd -ms /bin/bash node
ADD . /data
# This next line doesn't seem to have any effect:
RUN chown -R node /data
ENV HOME /home/node
USER node
RUN cd /data && npm install
EXPOSE 8888
WORKDIR /data
CMD ["npm", "start"]
Run Code Online (Sandbox Code Playgroud)
非常简单,但是当我ls -l
仍然拥有root时:
[ node@ed7ae33e76e1:/data {docker-nonroot-user} ]$ ls -l /data
total 64K
-rw-r--r-- 1 root root 383 Jun 18 20:32 Dockerfile …
Run Code Online (Sandbox Code Playgroud) 您好我不明白为什么我有这个错误,我认为回调是在收到数据后执行的,任何想法来自哪里?非常感谢!
节点错误:
SyntaxError: Unexpected end of input
at Object.parse (native)
Run Code Online (Sandbox Code Playgroud)
我解析了正文的答案,然后将其发送到计算函数,然后再将其发送到页面= /
var options = {
method: 'POST',
url: self.rippledataapiProxyHost.account_offers_exercised,
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body:parameters
};
var callback = function(error, response, body) {
if (error) {
console.log('error', error);
res.send(500, 'something went wrong');
}
console.dir("bodyyyyyyyy====>",body);
var rippleoffersexercised = new self.datacalcul.rippleoffersexercised;
var data = JSON.parse(body);
var datas = rippleoffersexercised.calculate(data);
res.status(response.statusCode).send(datas);
}
request(options, callback);
Run Code Online (Sandbox Code Playgroud)
这是堆栈跟踪:
'bodyyyyyyyy====>'
SyntaxError: Unexpected end of input
at Object.parse (native)
at Request.callback [as _callback] (/home/francois/dev/ripplereport/webserver-newclientFrancois/server/middlewares/proxy/rippledataapiProxy.js:77:20)
at …
Run Code Online (Sandbox Code Playgroud) 这里messageSource
定义了Grails i18n插件中定义的bean :
messageSource(PluginAwareResourceBundleMessageSource) {
basenames = baseNames.toArray()
fallbackToSystemLocale = false
pluginManager = manager
....
}
Run Code Online (Sandbox Code Playgroud)
是否可以覆盖fallbackToSystemLocale
我的resources.groovy中的值的配置,例如:
messageSource {
fallbackToSystemLocale = true
}
Run Code Online (Sandbox Code Playgroud)
以上不起作用,我得到一个错误:"创建名为'messageSource'的bean时出错:Bean定义是抽象的"
不确定这是否是一个错误ansible-galaxy
,但我正在尝试从requirements.yml文件(相关的ansible文档)安装角色.其中一个角色是从git中提取的,具体version
如下:
requirements.yml:
---
- src: https://github.com/thom-nic/ansible-shell
name: thom-nic.shell
version: develop
Run Code Online (Sandbox Code Playgroud)
当我运行时,ansible-galaxy install
我得到以下输出:
± ansible-galaxy install -r requirements.yml --force
- executing: git clone https://github.com/thom-nic/ansible-shell thom-nic.shell
- executing: git archive --prefix=thom-nic.shell/ --output=/var/folders/cw/9vh4w77n4vb_bchhsxnglrcm0000gn/T/tmpF4GAqD.tar develop
- command git archive --prefix=thom-nic.shell/ --output=/var/folders/cw/9vh4w77n4vb_bchhsxnglrcm0000gn/T/tmpF4GAqD.tar develop failed
in directory /var/folders/cw/9vh4w77n4vb_bchhsxnglrcm0000gn/T/tmpIyYaJz
- thom-nic.shell was NOT installed successfully.
Run Code Online (Sandbox Code Playgroud)
如果我改变version
到master
它的工作原理.我已经在git repos中尝试了其他角色,结果相同.
奇怪的是,ansible-galaxy
本身似乎没有--version
输出,但ansible --version
报告v1.8.3.
我无法找到解释赛普拉斯断言在cy.get()
匹配多个元素时如何工作的文档。例如:
标记:
<div>
<button>one</button>
<button class='green'>two</button>
<button disabled>three</button>
</div>
Run Code Online (Sandbox Code Playgroud)
测试:
cy.get('button').should('be.disabled');
Run Code Online (Sandbox Code Playgroud)
赛普拉斯是否断言:
根据经验,我猜测这是选项 3,但我无法在文档中找到明确解决的问题。
然而
cy.get('button').click();
Run Code Online (Sandbox Code Playgroud)
点击...只有第一个按钮?他们全部?
关于断言,恐怕我们无意中编写了在我们的选择器偶然匹配多个元素并且其中一个元素恰好与断言标准匹配的情况下通过的测试。
显然,通过编写良好的选择器,或者如果我们希望返回多个元素,或者如果我们想显式断言多个元素,或者使用 or ,可以避免这种情况。我主要是寻找对行为的确认,以便我了解 Cypress 在选择多个元素(有意或无意)的情况下如何工作。.first()
.last()
.each()