Nginx厨师Docker
我是Docker概念的新手。对于应用程序,我需要创建NGINX容器。 nginx配置在厨师食谱中,因此我有示例。我不确定如何容器。我将.conf.erb复制到/etc/nginx/conf.d/example.conf.erb。我不确定该怎么办。我很困惑,没有资源在线需要立即帮助 Default.rb:
include_recipe 'nginx_ldap_auth'
include_recipe 'nginx'
template 'nginx config' do
source 'example.conf.erb'
path '/etc/nginx/conf.d/example.conf.erb'
owner 'root'
group 'root'
mode ''
variables({'environment variables'})
notifies :restart, 'service[nginx])'
我的Dockerfile当前看起来像这样:
FROM nginx:alpine
COPY default.conf /etc/nginx/example.conf.erb/
我不确定是否需要Docker-Compose。除了Dockerfile之外,我还没有创建太多。请指导
I am new to docker concept. For an application I need to create nginx container.
The nginx configuration is in chef cookbook, hence I have example.conf.erb file and default.rb (containing setup nginx file) in my chef/cookbook/ directory . I am not sure how to containerise. I copied .conf.erb to /etc/nginx/conf.d/example.conf.erb. I am not sure what else to do. I am confused and no resource online need help immediate
default.rb :
include_recipe 'nginx_ldap_auth'
include_recipe 'nginx'
template 'nginx config' do
source 'example.conf.erb'
path '/etc/nginx/conf.d/example.conf.erb'
owner 'root'
group 'root'
mode ''
variables({'environment variables'})
notifies :restart, 'service[nginx])'
My Dockerfile currently look like this:
FROM nginx:alpine
COPY default.conf /etc/nginx/example.conf.erb/
I am not sure if I need docker-compose. Apart from Dockerfile there is nothing much I have created. Please guide
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先让厨师创建配置文件,然后运行运行Docker构建以创建图像。
或者,您可以查看多阶段Dockerfiles 。
使用多个阶段,您可以首先使用包含厨师的图像,在那里创建配置文件,然后将其复制到Nginx图像中。
Either first let Chef create the config file and then run run docker build to create an image.
Or you can check out a multi stage dockerfiles.
With multiple stages you can first use an image that includes Chef, there create the config file and then copy it into the nginx image.