dockerfile-dsl
Dockerfile DSL in Ruby
Installation
$ gem install dockerfile-dsl
Usage
Code:
require 'dockerfile-dsl'
file = dockerfile do
from :ubuntu
run 'sudo apt install nginx'
add 'nginx.conf', '/etc/nginx.conf'
cmd [:service, :nginx, :start]
end
puts file
Output:
FROM ubuntu
RUN sudo apt install nginx
ADD nginx.conf /etc/nginx.conf
CMD ["service", "nginx", "start"]
For more examples, see examples directory.