From 88a7e100c6d03b3448bc8451d940feb9a358abd9 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Jan 21 2021 03:23:48 +0000 Subject: Update Containerfile to use a fully qualified image This change improves image building by not requiring a registry lookup for unqualified image name. --- diff --git a/Dockerfile b/Dockerfile index 3b60e35..10c2f58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM fedora +FROM registry.fedoraproject.org/fedora:33 # Install system dependencies RUN dnf update -y && dnf install -y fedora-messaging python-requests && dnf clean all diff --git a/README.md b/README.md index 306d645..8f5d9f3 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ PYTHONPATH=. fedora-messaging --conf ./conf/config.toml consume --callback=fmgat ## Container build and run ``` -dhall text <<< '(../../github.com/softwarefactory-project/dhall-containerfile/package.dhall).render ./container.dhall' > Dockerfile +dhall text <<< '(./container.dhall).file' > Dockerfile podman build -f Dockerfile -t quay.io/software-factory/fm-gateway ``` @@ -24,6 +24,7 @@ podman push quay.io/software-factory/fm-gateway ``` ## Run with Podman + ``` podman run -it -v ./conf:/data:Z -p 127.0.0.1:8080:80 quay.io/software-factory/fm-gateway ``` diff --git a/container.dhall b/container.dhall index e5c7c3d..5a22089 100644 --- a/container.dhall +++ b/container.dhall @@ -1,31 +1,36 @@ let Containerfile = - https://raw.githubusercontent.com/softwarefactory-project/dhall-containerfile/master/package.dhall + https://softwarefactory-project.io/cgit/software-factory/dhall-containerfile/plain/package.dhall sha256:03a6e298ff140d430cea8b387fad886ce9f5bee24622c7d1102115cc08ed9cf9 -in Containerfile.from "fedora" - # Containerfile.emptyLine - # Containerfile.run - "Install system dependencies" - [ "dnf update -y" - , "dnf install -y fedora-messaging python-requests" - , "dnf clean all" - ] - # Containerfile.run "Install pip deps" [ "pip install prometheus_client " ] - # Containerfile.volume [ "/data" ] - # Containerfile.copy [ "fmgateway", "fmgateway" ] - # Containerfile.copy [ "setup.py", "setup.py" ] - # Containerfile.emptyLine - # Containerfile.run "Install FMGateway" [ "python setup.py install" ] - # Containerfile.label - ( toMap - { description = "FMGateway", maintainer = "fboucher@redhat.com" } - ) - # Containerfile.emptyLine - # Containerfile.exposeTcp 80 - # Containerfile.emptyLine - # Containerfile.entrypoint - [ "/usr/bin/fedora-messaging" - , "--conf" - , "/data/config.toml" - , "consume" - , "--callback=fmgateway.callback:Consumer" - ] +let image = + Containerfile.from "registry.fedoraproject.org/fedora:33" + # Containerfile.emptyLine + # Containerfile.run + "Install system dependencies" + [ "dnf update -y" + , "dnf install -y fedora-messaging python-requests" + , "dnf clean all" + ] + # Containerfile.run + "Install pip deps" + [ "pip install prometheus_client " ] + # Containerfile.volume [ "/data" ] + # Containerfile.copy [ "fmgateway", "fmgateway" ] + # Containerfile.copy [ "setup.py", "setup.py" ] + # Containerfile.emptyLine + # Containerfile.run "Install FMGateway" [ "python setup.py install" ] + # Containerfile.label + ( toMap + { description = "FMGateway", maintainer = "fboucher@redhat.com" } + ) + # Containerfile.emptyLine + # Containerfile.exposeTcp 80 + # Containerfile.emptyLine + # Containerfile.entrypoint + [ "/usr/bin/fedora-messaging" + , "--conf" + , "/data/config.toml" + , "consume" + , "--callback=fmgateway.callback:Consumer" + ] + +in { image, file = Containerfile.render image }