{"id":13739806,"url":"https://github.com/softwarefactory-project/dhall-containerfile","last_synced_at":"2026-06-01T12:31:33.852Z","repository":{"id":83298907,"uuid":"283874515","full_name":"softwarefactory-project/dhall-containerfile","owner":"softwarefactory-project","description":"Manage your Containerfile with Dhall.","archived":false,"fork":false,"pushed_at":"2021-10-26T14:28:18.000Z","size":192,"stargazers_count":31,"open_issues_count":0,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-08T19:45:45.370Z","etag":null,"topics":["containerfile","dhall","dhall-lang"],"latest_commit_sha":null,"homepage":"https://docs.softwarefactory-project.io/dhall-containerfile/","language":"Dhall","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softwarefactory-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-07-30T20:52:48.000Z","updated_at":"2025-01-15T05:43:43.000Z","dependencies_parsed_at":"2023-03-12T17:55:08.739Z","dependency_job_id":null,"html_url":"https://github.com/softwarefactory-project/dhall-containerfile","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/softwarefactory-project/dhall-containerfile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwarefactory-project%2Fdhall-containerfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwarefactory-project%2Fdhall-containerfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwarefactory-project%2Fdhall-containerfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwarefactory-project%2Fdhall-containerfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softwarefactory-project","download_url":"https://codeload.github.com/softwarefactory-project/dhall-containerfile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwarefactory-project%2Fdhall-containerfile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33775857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containerfile","dhall","dhall-lang"],"created_at":"2024-08-03T04:00:37.815Z","updated_at":"2026-06-01T12:31:33.835Z","avatar_url":"https://github.com/softwarefactory-project.png","language":"Dhall","funding_links":[],"categories":["others","Dhall","Libraries"],"sub_categories":[],"readme":"# dhall-containerfile\n\nManage your Containerfile with [Dhall][dhall-lang].\n\nMain [documentation](https://docs.softwarefactory-project.io/dhall-containerfile/)\n\n## Usage\n\nThe package provides convenient function to create the statements:\n\n```dhall\n-- ./examples/demo.dhall\nlet Containerfile = ../package.dhall\n\nin    Containerfile.from \"fedora\"\n    # Containerfile.emptyLine\n    # Containerfile.run\n        \"Install emacs\"\n        [ \"dnf update -y\", \"dnf install -y emacs-nox\", \"dnf clean all\" ]\n    # Containerfile.volume [ \"/data\" ]\n    # Containerfile.label\n        ( toMap\n            { description = \"a text editor\"\n            , maintainer = \"tdecacqu@redhat.com\"\n            }\n        )\n    # Containerfile.emptyLine\n    # Containerfile.entrypoint [ \"emacs\" ]\n\n```\n\n```\n# dhall text \u003c\u003c\u003c '(./package.dhall).render ./examples/demo.dhall'\nFROM fedora\n\n# Install emacs\nRUN dnf update -y \u0026\u0026 dnf install -y emacs-nox \u0026\u0026 dnf clean all\n\nVOLUME [\"/data\"]\nLABEL description=\"a text editor\"\nLABEL maintainer=\"tdecacqu@redhat.com\"\n\nENTRYPOINT [\"emacs\"]\n\n```\n\n## Reference\n\nThe package implements the [Containerfile reference][ref] with these changes:\n\n* `Exec` is the `RUN` exec form\n* `Cmd` only supports the preferred exec form\n* `Empty` denotes an empty lines\n* `Add` only supports the list form without chown argument\n* `Copy` only supports the list form without chown argument\n* `Entrypoint` only supports the prefered exec form\n\n```dhall\n-- ./Containerfile/Statement.dhall\n{-|\nBased on [Dockerfile format](https://docs.docker.com/engine/reference/builder/#format)\n-}\nlet Prelude = ../Prelude.dhall\n\nin    \u003c From : Text\n      | Run : Text\n      | Cmd : List Text\n      | Exec : List Text\n      | Label : Prelude.Map.Type Text Text\n      | Expose : Text\n      | Env : Prelude.Map.Type Text Text\n      | Add : List Text\n      | Copy : List Text\n      | CopyFrom : { from : Text, files : List Text }\n      | Entrypoint : List Text\n      | Volume : List Text\n      | User : Text\n      | Workdir : Text\n      | Arg : Prelude.Map.Type Text Text\n      | Shell : List Text\n      | Comment : Text\n      | Empty\n      \u003e\n    : Type\n\n```\n\n## Example\n\nA complete example to build an ffmpeg image with some options:\n\n```dhall\n-- ./examples/ffmpeg.dhall\nlet Containerfile = ../package.dhall\n\nlet FfmpegOption =\n      { Type = { x264 : Bool, xcb : Bool }\n      , default = { x264 = True, xcb = True }\n      }\n\nlet buildLib =\n      \\(name : Text) -\u003e\n      \\(url : Text) -\u003e\n      \\(build-commands : List Text) -\u003e\n        Containerfile.run\n          \"${name}: ${Containerfile.concatSep \" \" build-commands}\"\n          (   [ \"cd /usr/local/src\"\n              , \"git clone --depth 1 ${url}\"\n              , \"cd ${name}\"\n              ]\n            # build-commands\n            # [ \"make\", \"make install\" ]\n          )\n\nlet make\n    : FfmpegOption.Type -\u003e Containerfile.Type\n    = \\(options : FfmpegOption.Type) -\u003e\n        let build-reqs =\n                [ \"autoconf\"\n                , \"automake\"\n                , \"cmake\"\n                , \"freetype-devel\"\n                , \"gcc\"\n                , \"gcc-c++\"\n                , \"git\"\n                , \"libtool\"\n                , \"make\"\n                , \"nasm\"\n                , \"pkgconfig\"\n                , \"zlib-devel\"\n                , \"numactl-devel\"\n                ]\n              # Containerfile.optionalTexts options.xcb [ \"libxcb-devel\" ]\n\n        let runtime-reqs =\n                [ \"numactl\" ]\n              # Containerfile.optionalTexts options.xcb [ \"libxcb\" ]\n\n        let x264-build =\n              Containerfile.optionalStatements\n                options.x264\n                ( buildLib\n                    \"x264\"\n                    \"https://code.videolan.org/videolan/x264.git\"\n                    [ \"./configure --prefix=\\\"/usr/local\\\" --enable-static\" ]\n                )\n\n        let yasm-build =\n              buildLib\n                \"yasm\"\n                \"git://github.com/yasm/yasm.git\"\n                [ \"autoreconf -fiv\", \"./configure --prefix=\\\"/usr/local\\\"\" ]\n\n        let ffmpeg-build =\n              buildLib\n                \"ffmpeg\"\n                \"git://source.ffmpeg.org/ffmpeg\"\n                [ Containerfile.concatSep\n                    \" \"\n                    (   [ \"PKG_CONFIG_PATH=\\\"/usr/local/lib/pkgconfig\\\"\"\n                        , \"./configure\"\n                        , \"--prefix=\\\"/usr/local\\\"\"\n                        , \"--extra-cflags=\\\"-I/usr/local/include\\\"\"\n                        , \"--extra-ldflags=\\\"-L/usr/local/lib\\\"\"\n                        , \"--pkg-config-flags=\\\"--static\\\"\"\n                        , \"--enable-gpl\"\n                        , \"--enable-nonfree\"\n                        ]\n                      # Containerfile.optionalTexts\n                          options.x264\n                          [ \"--enable-libx264\" ]\n                      # Containerfile.optionalTexts\n                          options.xcb\n                          [ \"--enable-libxcb\" ]\n                    )\n                ]\n\n        let bootstrap =\n              Containerfile.run\n                \"Install build and runtime reqs\"\n                [     \"dnf install -y \"\n                  ++  Containerfile.concatSep \" \" (build-reqs # runtime-reqs)\n                ]\n\n        let cleanup =\n              Containerfile.run\n                \"Cleanup\"\n                [ \"rm -Rf /usr/local/src/*\"\n                , \"dnf clean all\"\n                , \"dnf erase -y \" ++ Containerfile.concatSep \" \" build-reqs\n                ]\n\n        in    Containerfile.from \"fedora:latest\"\n            # Containerfile.emptyLine\n            # bootstrap\n            # yasm-build\n            # x264-build\n            # ffmpeg-build\n            # cleanup\n            # Containerfile.entrypoint [ \"/usr/local/bin/ffmpeg\" ]\n\nin  { Containerfile = Containerfile.render (make FfmpegOption.default)\n    , make\n    , buildLib\n    }\n\n```\n\n```text\n# dhall text \u003c\u003c\u003c '(./examples/ffmpeg.dhall).Containerfile'\nFROM fedora:latest\n\n# Install build and runtime reqs\nRUN dnf install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel numactl-devel libxcb-devel numactl libxcb\n\n# yasm: autoreconf -fiv ./configure --prefix=\"/usr/local\"\nRUN cd /usr/local/src \u0026\u0026 git clone --depth 1 git://github.com/yasm/yasm.git \u0026\u0026 cd yasm \u0026\u0026 autoreconf -fiv \u0026\u0026 ./configure --prefix=\"/usr/local\" \u0026\u0026 make \u0026\u0026 make install\n\n# x264: ./configure --prefix=\"/usr/local\" --enable-static\nRUN cd /usr/local/src \u0026\u0026 git clone --depth 1 https://code.videolan.org/videolan/x264.git \u0026\u0026 cd x264 \u0026\u0026 ./configure --prefix=\"/usr/local\" --enable-static \u0026\u0026 make \u0026\u0026 make install\n\n# ffmpeg: PKG_CONFIG_PATH=\"/usr/local/lib/pkgconfig\" ./configure --prefix=\"/usr/local\" --extra-cflags=\"-I/usr/local/include\" --extra-ldflags=\"-L/usr/local/lib\" --pkg-config-flags=\"--static\" --enable-gpl --enable-nonfree --enable-libx264 --enable-libxcb\nRUN cd /usr/local/src \u0026\u0026 git clone --depth 1 git://source.ffmpeg.org/ffmpeg \u0026\u0026 cd ffmpeg \u0026\u0026 PKG_CONFIG_PATH=\"/usr/local/lib/pkgconfig\" ./configure --prefix=\"/usr/local\" --extra-cflags=\"-I/usr/local/include\" --extra-ldflags=\"-L/usr/local/lib\" --pkg-config-flags=\"--static\" --enable-gpl --enable-nonfree --enable-libx264 --enable-libxcb \u0026\u0026 make \u0026\u0026 make install\n\n# Cleanup\nRUN rm -Rf /usr/local/src/* \u0026\u0026 dnf clean all \u0026\u0026 dnf erase -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel numactl-devel libxcb-devel\n\nENTRYPOINT [\"/usr/local/bin/ffmpeg\"]\n\n```\n\n## Changes\n\nFrozen package are available in the tag commit.\n\n### 0.4.0\n\n- Add `user` helper\n\n### 0.3.0\n\n- Initial release\n\n[dhall-lang]: https://dhall-lang.org\n[ref]: https://docs.docker.com/engine/reference/builder/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwarefactory-project%2Fdhall-containerfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftwarefactory-project%2Fdhall-containerfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwarefactory-project%2Fdhall-containerfile/lists"}