我正在尝试通过ppa(RUN add-apt-repository ppa:webupd8team/java -y)在我的docker镜像中安装java7,但它失败并出现此错误:
returned a non-zero code: 127
Run Code Online (Sandbox Code Playgroud)
以下是建议正确安装的方法,但它不起作用.我也试过了两个ppas.
RUN apt-get install python-software-properties -y
RUN add-apt-repository ppa:webupd8team/java -y
#RUN add-apt-repository ppa:eugenesan/java -y
RUN apt-get update
RUN apt-get install oracle-java7-installer -y
Run Code Online (Sandbox Code Playgroud)
这是日志输出:
Step 28 : RUN add-apt-repository ppa:webupd8team/java -y
---> Running in b278761a4209
[91m/bin/sh: 1: add-apt-repository: not found
[0m
Run Code Online (Sandbox Code Playgroud)
所以...我需要找出辅助库中存在此命令的位置或内容:
add-apt-repository
Run Code Online (Sandbox Code Playgroud)
add-apt-repository似乎是python-software-properties安装的一部分.除了在构建的其他区域弹出的这些消息之外,我在该步骤中没有看到任何真正的错误.所以我假设如果我能解决这个问题,前面提到的python步骤将根据需要安装:
[91mdebconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
[0m[91mdebconf: unable …Run Code Online (Sandbox Code Playgroud) 我有一个容器设置来运行elasticsearch.服务启动但我无法通过curl或浏览器连接到它.
RUN \
cd /tmp && \
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch- 1.3.2.tar.gz && \
tar xvzf elasticsearch-1.3.2.tar.gz && \
rm -f elasticsearch-1.3.2.tar.gz && \
mv /tmp/elasticsearch-1.3.2 /elasticsearch
# Define mountable directories.
VOLUME ["/data"]
# Define default command.
CMD ["/elasticsearch/bin/elasticsearch"]
EXPOSE 9200
EXPOSE 9300
Run Code Online (Sandbox Code Playgroud)
连接不http://localhost:9200产生任何结果.docker ps显示端口;
0.0.0.0:49179->9200/tcp, 0.0.0.0:49180->9300/tcp
...
net::ERR_ADDRESS_UNREACHABLE
Run Code Online (Sandbox Code Playgroud)
我错过了一些配置值吗?谢谢!
[更新]我也在run命令中尝试了-p
docker run -i -p 9200:9200 -p 9300:9300 -t --rm -P team1/image1
Run Code Online (Sandbox Code Playgroud) 在ajax调用期间,将显示进度模式,然后在完成或失败时,应通过调用隐藏它$("#progessDialog").modal("hide");.hide事件似乎没有解雇.我在ajax失败处理程序中有一个事件挂钩,定义为在触发hide事件时记录它并且它永远不会记录但是另一个日志按照预期的那样打印:
$('#progessDialog').on('hidden.bs.modal', function (e) {
console.log('calling modal hide');
});
Run Code Online (Sandbox Code Playgroud)
重现步骤:
模态拒绝隐藏并且js调用完成后,当我进入$("#progessDialog").modal("hide")开发控制台时,模态会按预期隐藏.
注意:尚未完成,所以不要在用户界面上抹布,但是,我愿意接受一些建设性的批评来改进UX/JS.接下来是零验证.
我已经看到其他几个SO问题本质上相似但不是真的相同(这些问题似乎隐藏了一些模态而不是背景 - 我的情况是完整的模态).
这里有一个js小提琴再现问题:https://jsfiddle.net/willtx/8dpL5rLd/29/
<div class="modal fade" id="progessDialog" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-labelledby="progessDialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<h5 class="modal-title" id="progessDialoglLabel">Processing...</h5>
<div class="progress">
<div class="progress-bar progress-bar-striped bg-info" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 启动(docker run)rabbitmq 镜像会导致崩溃。startup_err的内容:
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
Run Code Online (Sandbox Code Playgroud)
启动日志
BOOT FAILED
===========
Error description:
{error,{cannot_create_mnesia_dir,"/var/lib/rabbitmq/mnesia/rabbit@localhost/",
eacces}}
Log files (may contain more information):
/var/log/rabbitmq/rabbit@localhost.log
/var/log/rabbitmq/rabbit@localhost-sasl.log
Stack trace:
[{rabbit_mnesia,ensure_mnesia_dir,0,
[{file,"src/rabbit_mnesia.erl"},{line,472}]},
{rabbit_node_monitor,prepare_cluster_status_files,0,
[{file,"src/rabbit_node_monitor.erl"},{line,99}]},
{rabbit,'-boot/0-fun-1-',0,[{file,"src/rabbit.erl"},{line,326}]},
{rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,354}]},
{init,start_it,1,[]},
{init,start_em,1,[]}]
{"init terminating in do_boot",{rabbit,failure_during_boot,{error, {cannot_create_mnesia_dir,"/var/lib/rabbitmq/mnesia/rabbit@localhost/",eacces}}}}
Run Code Online (Sandbox Code Playgroud)
这是 Dockerfile 的rabbitmq 部分:
RUN apt-get install rabbitmq-server -y
ENV RABBITMQ_CONFIG_FILE /etc/rabbitmq/rabbitmq
ADD rabbitmq.config /etc/rabbitmq/rabbitmq.config
# plugins --offline
RUN /usr/sbin/rabbitmq-plugins enable rabbitmq_management
RUN /usr/sbin/rabbitmq-plugins enable rabbitmq_shovel
RUN /usr/sbin/rabbitmq-plugins enable rabbitmq_shovel_management
EXPOSE 5672 15672 4369
VOLUME …Run Code Online (Sandbox Code Playgroud) 我似乎无法开始业力.当它试图加载服务时它失败了.这是spec文件:
describe('Service: angelloModel', function () {
beforeEach(module('Angello'));
var modelService;
beforeEach(inject(function (angelloModel) {
modelService = angelloModel;
}));
describe('#getStatuses', function () {
it('should return seven different statuses', function () {
expect(modelService.getStatuses().length).toBe(7);
});
})
});
Run Code Online (Sandbox Code Playgroud)
要使用的文件的karam配置部分:
files: [
'bower_components/angular/angular.js',
app.js',
'tests/*.spec.js'
],
Run Code Online (Sandbox Code Playgroud)
最后是错误:
INFO [karma]: Karma v0.12.16 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 34.0.1847 (Mac OS X 10.9.2)]: Connected on socket edWal-wdFxcFp1KPQndO with id 43277901
Chrome 34.0.1847 (Mac OS X 10.9.2) Service: angelloModel encountered a declaration exception FAILED …Run Code Online (Sandbox Code Playgroud) 我正在努力掌握码头图像/容器管理.我在构建之后运行以下命令以帮助保持磁盘空间的使用:
docker rm $(docker ps -a -q)
docker images | awk '/^<none>/ {print $3}' | xargs docker rmi
Run Code Online (Sandbox Code Playgroud)
这很好用.我有时会使用图片ID手动删除图片.当我删除图像时,特别是在重新创建时,报告的创建时间来自原始创建的时间帧.我希望它是它创建的日期.例如:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
<none> <none> 4eb6a3fb4a76 5 days ago 1.587 GB
user1/image1 latest cc710febe57e 5 days ago 1.597 GB
Run Code Online (Sandbox Code Playgroud)
这是为什么?图像是否保留已删除图像中的项目?我最初是在5天前创建的.我希望它在今天创建图像后有一个新创建的值.
另外,如果您不知道,请使用--rm with run在停止后清理容器.
我想在stormpath登录屏幕中禁用创建帐户.应该已经通过对应用程序进行身份验证的用户调用api.我尝试将stormpathEnableRegistration设置为false,但仍启用了注册功能.
app.use(stormpath.init(app, {
apiKeyFile: config.stormpathapi.apiKeyFile,
application: config.stormpathapi.application,
secretKey: config.stormpathapi.secretKey,
sessionDuration: 1000 * 60 * 30,
enableAutoLogin: true,
enableUsername: true,
stormpathEnableRegistration: false
}));
Run Code Online (Sandbox Code Playgroud)
谢谢!
目标:使用组件而不是使用$ scope来设置数据.没有要共享的错误,问题是对话框加载组件时未设置数据元素.屏幕截图显示了对话框的当前状态,应该在选项卡#2(信息)中绑定一个对象.在使用onComplete事件加载对话框后,我可以验证对象(文档)是否可用.我试图通过以下方式将对话框调用可用的数据绑定到组件:
locals: {
document: document
},
bindToController: true,
onComplete: function(){
console.log('document: %O', document);
}
Run Code Online (Sandbox Code Playgroud)
bindings: {
document: '='
}
Run Code Online (Sandbox Code Playgroud)
resolve: {
document: function() {
return document;
}
}
Run Code Online (Sandbox Code Playgroud)
我相信错误在这里,绑定,"旧方式"使用$ scope vars所以绑定毫不费力地连接.
(function(){
'use strict';
angular.module('adminClientApp')
.component('documentEdit', {
templateUrl: 'js/app/components/document/documentEdit/document-edit.html',
controller: function DocumentEditController($mdToast, $mdMedia) {
var var documentEdit = this;
documentEdit.document;
},
bindings: {
document: '<'
}
});
})();
Run Code Online (Sandbox Code Playgroud)
DialogController中只有$ mdDialog事件.我意识到locals和bindToController都是针对对话框中指定的控制器(DialogController).我在这里难过 - 如何设置/传递/连接文件到组件控制器?
this.showEdit = function ($event, document) {
var parentEl = angular.element(document.body);
$mdDialog.show({
parent: …Run Code Online (Sandbox Code Playgroud) 以下代码从angularjs开始,然后通过节点进行路由,然后该节点应进行外部api调用.发生了什么,stormpath正在拦截呼叫并尝试对其进行身份验证(登录屏幕已提供...我检查了res.data).我认为应用程序很好,因为我最初必须登录.我没有在ui-router中定义路由,因为我希望节点处理它而不是角度.所以,我的问题是如何配置不同的层来处理呼叫.
angular - > node/stormpath - > external api
节点路由:
app.use('/api/v1/accounts/:search', stormpath.groupsRequired(['dataentry']), apiAccounts.findAll);
Run Code Online (Sandbox Code Playgroud)
stormpath设置:
app.use(stormpath.init(app, {
apiKeyFile: config.stormpathapi.apiKeyFile,
application: config.stormpathapi.application,
secretKey: config.stormpathapi.secretKey,
sessionDuration: 1000 * 60 * 30,
enableAutoLogin: true,
enableUsername: true
}));
Run Code Online (Sandbox Code Playgroud)
角度代码:
$scope.getCustomers = function(chars) {
var customers = [],
url = 'api/v1/accounts/' + encodeURIComponent(chars) + '/';
console.log('getCustomers: ' + url);
try
{
//return $http.jsonp(url)
return $http.get(url)
.then(function(res) {
if(angular.isArray(res.data))
{
customers = res.data;
}
return customers;
}, function (error) {
console.log('Unable to load the customers: ' + …Run Code Online (Sandbox Code Playgroud) 我需要将它展平为新系列中的一个项目.
输入将是IEnumerable集合.基类如下所示:
public class ConversionsResult
{
public int SiteId { get; set; }
public int TotalLeads { get; set; }
public int TotalCalls { get; set; }
public int TotalEmails { get; set; }
public int UniqueVisits { get; set; }
public int MetricYear { get; set; }
public int MetricMonth { get; set; }
public string DeviceCategory { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
扁平化的类看起来像这样:
SiteId, MetricMonth, MetricYear SUM(TotalLeads), SUM(TotalEmails), SUM(UniqueVisits), CONCATENATE(DeviceCategory).
Run Code Online (Sandbox Code Playgroud)
笔记:
我可以完成另一条路线,但我想使用LINQ.我试图破解我找到的一些解决方案,但这是一团糟,所以我排除了我试过的噪音.