No description
Find a file
2023-02-03 10:58:06 +01:00
.github/workflows update CI ; reorg tests 2023-01-30 10:10:56 +01:00
examples fix user experience to run examples 2023-02-03 10:58:06 +01:00
src bump version ; fix release example 2023-02-03 10:47:12 +01:00
tests add example directory 2023-02-03 10:32:46 +01:00
.gitignore fix user experience to run examples 2023-02-03 10:58:06 +01:00
containertools.nimble bump version ; fix release example 2023-02-03 10:47:12 +01:00
LICENSE Initial commit 2023-01-30 09:20:30 +01:00
README.md add example directory 2023-02-03 10:32:46 +01:00
TODO.md add example directory 2023-02-03 10:32:46 +01:00

containertools

a work-in-progress library and a DSL to handle container spec files

starting develoment as a HackWeek project : https://hackweek.opensuse.org/22/projects/containerfile-slash-dockerfile-generator-library

basic usage examples:

import containertools
let image = container:
    FROM "opensuse/leap"
    CMD "echo Hello"

image.save "Containerfile"
image.build  
import containertools
let image = container:
    FROM "node:16"
    COPY ". ."
    RUN "npm install"
    EXPOSE 3000
    CMD @["node", "index.js"]
image.save "Containerfile"
image.build  

a dynamic example:

for i in countup(0, 3):
    images[i] = container:
    FROM "opensuse/leap"
    if i mod 2 == 0:
        ENV &"buildno={i}.0"
        LABEL "Environment=PROD"
        RUN "zypper install nginx-stable"
    else:
        ENV &"buildno={i}.1"
        LABEL "Environment=DEV"
        RUN "zypper install nginx-testing"
#images.mapIt(push(it,MY_REGISTRY)) # pushes all to remote registry