Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jobcespedes/dockerfile_builder

Generate Dockerfiles and build image containers using Ansible
https://github.com/jobcespedes/dockerfile_builder

Last synced: 25 days ago
JSON representation

Generate Dockerfiles and build image containers using Ansible

Awesome Lists containing this project

README

        

Role Name: dockerfile_builder
=========

[![Build Status](https://travis-ci.com/jobcespedes/dockerfile_builder.svg?branch=master)](https://travis-ci.com/jobcespedes/dockerfile_builder) [![Buy me a coffee](https://img.shields.io/badge/$-BuyMeACoffee-blue.svg)](https://www.buymeacoffee.com/jobcespedes)

Generate Dockerfiles and build image containers using Docker (default) or Podman

Requirements
------------

- docker(default) or podman
- rsync

Role Variables
--------------

- See [`defaults/main.yml`](defaults/main.yml).

Dependencies
------------

- Depends on other Ansible roles: no

Example Playbook
----------------
Create a folder structure for your container(s). There should be at least a Dockerfile.j2 template there. The following is an example for multiple containers:
```bash
├── example.com
│   ├── mycontainer
│   │   ├── conf
│   │   │   └── myfile
│   │   └── Dockerfile.j2
│   └── mycontainer2
│   ├── conf
│   │   └── myfile2
│   └── Dockerfile.j2
├── playbook.yml

```

```yaml
- hosts: all
vars:
mycontainers:
- example.com/mycontainer
- example.com/mycontainer2
tasks:
- name: include builder role
loop: "{{ mycontainers }}"
vars:
dockerfile_builder_image: "{{ item }}"
include_role:
name: jobcespedes.dockerfile_builder
```

License
-------

MIT

Author Information
------------------

Job Céspedes Ortiz: [email protected]