From 7f59f7bb557d3ef29fa67b3d0cc6363584b7a4d0 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 10 Jul 2019 02:06:35 +0300 Subject: [PATCH] Dockerfiles improvements --- centos6.docker | 16 ++++++++++++++-- centos7.docker | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/centos6.docker b/centos6.docker index bc360f1..088bf51 100644 --- a/centos6.docker +++ b/centos6.docker @@ -1,3 +1,5 @@ +## BUILDER ##################################################################### + FROM centos:6 as builder RUN mkdir -p "/go/src" && chmod -R 777 "/go" @@ -8,22 +10,32 @@ WORKDIR /go/src/github.com/essentialkaos/perfecto COPY . . -RUN yum -y -q install https://yum.kaos.st/6/release/x86_64/kaos-repo-9.1-0.el6.noarch.rpm && \ +RUN yum -y -q install https://yum.kaos.st/kaos-repo-latest.el6.noarch.rpm && \ yum -y -q install make golang git upx && \ make deps && \ make all && \ upx perfecto +## FINAL IMAGE ################################################################# + FROM centos:6 +LABEL name="Perfecto Image on CentOS 6" \ + vendor="ESSENTIAL KAOS" \ + maintainer="Anton Novojilov" \ + license="EKOL" \ + version="2019.07.10" + COPY --from=builder /go/src/github.com/essentialkaos/perfecto/perfecto /usr/bin/ COPY common/rpmlint.conf /root/.config/rpmlint -RUN yum -y -q install https://yum.kaos.st/6/release/x86_64/kaos-repo-9.1-0.el6.noarch.rpm && \ +RUN yum -y -q install https://yum.kaos.st/kaos-repo-latest.el6.noarch.rpm && \ yum -y -q install rpmlint VOLUME /perfecto WORKDIR /perfecto ENTRYPOINT ["perfecto"] + +################################################################################ diff --git a/centos7.docker b/centos7.docker index c976bbd..d0bc98e 100644 --- a/centos7.docker +++ b/centos7.docker @@ -1,3 +1,5 @@ +## BUILDER ##################################################################### + FROM centos:7 as builder RUN mkdir -p "/go/src" && chmod -R 777 "/go" @@ -8,22 +10,32 @@ WORKDIR /go/src/github.com/essentialkaos/perfecto COPY . . -RUN yum -y -q install https://yum.kaos.st/7/release/x86_64/kaos-repo-9.1-0.el7.noarch.rpm && \ +RUN yum -y -q install https://yum.kaos.st/kaos-repo-latest.el7.noarch.rpm && \ yum -y -q install make golang git upx && \ make deps && \ make all && \ upx perfecto +## FINAL IMAGE ################################################################# + FROM centos:7 +LABEL name="Perfecto Image on CentOS 7" \ + vendor="ESSENTIAL KAOS" \ + maintainer="Anton Novojilov" \ + license="EKOL" \ + version="2019.07.10" + COPY --from=builder /go/src/github.com/essentialkaos/perfecto/perfecto /usr/bin/ COPY common/rpmlint.conf /root/.config/rpmlint -RUN yum -y -q install https://yum.kaos.st/7/release/x86_64/kaos-repo-9.1-0.el7.noarch.rpm && \ +RUN yum -y -q install https://yum.kaos.st/kaos-repo-latest.el7.noarch.rpm && \ yum -y -q install rpmlint VOLUME /perfecto WORKDIR /perfecto ENTRYPOINT ["perfecto"] + +################################################################################