我通过CoreOS和AWS的ECS运行docker.我有一个失败的图像多次重新启动,容器仍然在周围 - 他们填满了我的驱动器分区.具体来说,/var/lib/docker/overlay/
包含大量文件/目录.
我知道docker-cleanup-volumes是一个东西,但它清理/ volumes目录,而不是/ overlay目录.
docker ps -a
显示我的坏Docker容器超过250次启动尝试.但他们没有跑步.
除此之外rm -rf /var/lib/docker/overlay/*
,我该如何/我应该清理它?
如何添加具有Dockerfile的用户 - 以下操作无效.
USER vault
WORKDIR /usr/local/bin/vault
Run Code Online (Sandbox Code Playgroud)
我的完整Dockerfile:
FROM alpine:3.4
RUN apk update && apk add curl unzip
RUN useradd -ms /bin/bash vault
USER vault
WORKDIR /usr/local/bin/vault
ADD /vault.hcl /etc/vault/vault.hcl
RUN curl -SL https://releases.hashicorp.com/vault/0.5.0/vault_0.5.0_linux_amd64.zip > vault.zip
RUN unzip vault.zip -d /usr/local/bin && rm vault.zip
Run Code Online (Sandbox Code Playgroud) 我正在努力找出如何从我的代码动态获取我的aws_access_key_id和aws_secret_access_key.
在boto2中,我可以执行以下操作:boto.config.get_value('Credentials', 'aws_secret_access_key')
但我似乎无法在boto3中找到类似的方法.如果我看到的话,我能够找到钥匙,boto3.Session()._session._credentials
但这对我来说似乎是所有黑客的母亲,我宁愿不去那条路.
在EC2实例中使用AWS CLI时,如何指定我要使用实例配置文件凭据?文档说:
Instance profile credentials – these credentials can be used on EC2
instances with an assigned instance role, and are delivered through
the Amazon EC2 metadata service.
Run Code Online (Sandbox Code Playgroud)
这是自动的还是我需要调用元数据服务并将返回的凭据保存到~/.aws/credentials
文件中...然后拨打电话?
我想为我的映射添加一些额外的属性,在这种特殊情况下,我想修改我的英文索引中的标题字段,以便它使用英文分析器.
应该非常简单,除了我有很多类型的标题字段,似乎不可能这样做.
我遇到的错误如下:将update_all_types设置为true以更新所有类型的[search_quote_analyzer].
但我无法找到关于如何或在何处设置此'update_all_types'参数的单一参考.
这是我在Sense中使用的非常简单的代码:
PUT /my_index/_mapping/my_type
{
"properties": {
"title": {
"type": "string",
"analyzer": "english"
}
}
}
Run Code Online (Sandbox Code Playgroud)
那么,如果在其他类型中使用相同的字段,我该如何才能完成这项工作呢?
这是错误消息:
"type": "illegal_argument_exception",
"reason": "Mapper for [title] conflicts with existing mapping in other types:
[mapper [title] has different [analyzer], mapper [title] is used by
multiple types. Set update_all_types to true to update [search_analyzer]
across all types., mapper [title] is used by multiple types. Set
update_all_types to true to update [search_quote_analyzer] across
all types.]"
Run Code Online (Sandbox Code Playgroud)
所以我似乎需要在某处设置'update_all_types:true',但文档在那部分失败了.
我正在升级到Grails 2.3.9的Hibernate4:4.3.5.3插件.但是,我收到一个错误:
getGeneratedKeys() support is not enabled
Run Code Online (Sandbox Code Playgroud)
我无法找到有关如何启用此功能的任何配置详细信息.
如果我创建一个函数来获取网页。它会在每次执行时在不同的 IP 上执行它,以便我的抓取请求不会被阻止吗?
我开始使用CoreOS(在AWS ECS上).在启动我的第一个容器后,我看到了journalctl
:
Could not generate persistent MAC address for vethXXXX: No such file or directory
Run Code Online (Sandbox Code Playgroud)
这里有更多背景信息.我删除了时间和实例信息,但这都在同一秒内.请注意,有两个不同的veth
条目.我不知道这是否意味着什么.
systemd[1]: Started docker container 1234
systemd[1]: Starting docker container 1234
dockerd[595]: time="2015-07-23T23:30:52Z" level=info msg="GET /v1.17/containers/1234/json"
dockerd[595]: time="2015-07-23T23:30:52Z" level=info msg="+job container_inspect(1234)"
systemd-timesyncd[473]: Network configuration changed, trying to establish connection.systemd-udevd[7501]: Could not generate persistent MAC address for vethYYYY: No such file or directory
kernel: device vethXXXX entered promiscuous mode
kernel: IPv6: ADDRCONF(NETDEV_UP): vethXXXX: link is not ready
systemd-udevd[7508]: Could not generate persistent …
Run Code Online (Sandbox Code Playgroud) 我正在使用lineinfile如下:
lineinfile dest=./hosts_exp insertafter='\[hosts1\]' line="xxxxxxxxx" state=present
Run Code Online (Sandbox Code Playgroud)
我的hosts_exp
情况如下:
[local]
localhost
[hosts1]
[hosts2]
[hosts3]
Run Code Online (Sandbox Code Playgroud)
lineinfile在[hosts3]之后插入文本,而不是在[hosts1]之后插入它.
我有这样的时间字符串: 2013-08-22 16:56:19 Etc/GMT
我需要将它解析为datetime对象.我陷入了posix风格的时区,我无法让Python本地化.
这是一些尝试和他们的失败.我首先包括时区剥离版本,以显示解析是否正确.
datetime.strptime
>>> datetime.datetime.strptime("2013-08-22 16:56:19 UTC", "%Y-%m-%d %H:%M:%S %Z")
datetime.datetime(2013, 8, 22, 16, 56, 19)
>>> datetime.datetime.strptime("2013-08-22 16:56:19 Etc/GMT", "%Y-%m-%d %H:%M:%S %Z")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data '2013-08-22 16:56:19 Etc/GMT' does not match format '%Y-%m-%d %H:%M:%S %Z'
Run Code Online (Sandbox Code Playgroud)
time.strptime
>>> time.strptime("2013-08-22 16:56:19 UTC", "%Y-%m-%d %H:%M:%S %Z")
time.struct_time(tm_year=2013, tm_mon=8, tm_mday=22, tm_hour=16, tm_min=56, tm_sec=19, tm_wday=3, tm_yday=234, tm_isdst=0)
>>> time.strptime("2013-08-22 16:56:19 Etc/GMT", …
Run Code Online (Sandbox Code Playgroud) coreos ×2
docker ×2
amazon-ec2 ×1
amazon-ecs ×1
ansible ×1
aws-cli ×1
aws-lambda ×1
boto3 ×1
cloud ×1
datetime ×1
dockerfile ×1
grails ×1
grails-orm ×1
posix ×1
python ×1
python-3.x ×1
timezone ×1
web-scraping ×1
yaml ×1