我通过Fedora中的Dockerfile创建了一个简单的图像(最初为320 MB).
添加了Nano(这个1MB大小的小编辑器),图像大小已升至530 MB.我已经添加了Git(30-ish MB),然后我的图像大小天空火箭到830 MB.
这不是疯了吗?
我试图导出和导入容器以删除历史/中间图像.这项工作最多可节省25 MB,现在我的图像大小为804 MB.我也试过在一个上运行很多命令RUN
,但我仍然得到相同的初始830MB.
我怀疑是否值得使用Docker.我的意思是,我几乎没有安装任何东西而且我打了1GB.如果我必须添加一些像数据库等严重的东西,我可能会耗尽磁盘空间.
任何人都有可笑的大小图像?你如何解决?
除非我的Dockerfile非常不正确?
FROM fedora:latest
MAINTAINER Me NotYou <email@dot.com>
RUN yum -y install nano
RUN yum -y install git
Run Code Online (Sandbox Code Playgroud)
但很难想象这里会出现什么问题.
好的,我已经在这里浏览了很多主题,但没有一个能解决我的问题.我的问题很简单:我有超简单的自定义组件:
@FacesComponent("HelloWorldComponent")
public class HelloWorldComponent extends UIComponentBase {
public String getFamily() {
return "my.custom.component";
}
@Override
public void encodeBegin(FacesContext ctx) throws IOException {
String value = (String) getAttributes().get("value");
if (value != null) {
ResponseWriter writer = ctx.getResponseWriter();
writer.write(value.toUpperCase());
}
}
}
Run Code Online (Sandbox Code Playgroud)
但不幸的是我得到错误:
JSF1068: Cannot instantiate component with component-type HelloWorldComponent
Run Code Online (Sandbox Code Playgroud)
我的taglib:
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd" version="2.0">
<namespace>http://example.com/test</namespace>
<tag>
<tag-name>helloWorldComponent</tag-name>
<component>
<component-type>HelloWorldComponent</component-type>
</component>
</tag>
</facelet-taglib>
Run Code Online (Sandbox Code Playgroud)
关键是如果我将自定义组件放在faces-config中,一切都很完美,但作为JSF中一个非常顽固的新手,我确信必须有一种方法可以使注释工作而无需在faces-config中注册自定义组件.我希望有很多自定义组件,所以我想知道如何使它们使用纯注释,以免在faces-config中编写数百万行代码.
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" version="2.0">
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application> …
Run Code Online (Sandbox Code Playgroud)