Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
refactor fedora-28 Dockerfile for multi-stage
Browse files Browse the repository at this point in the history
Also moved package deps into spec file BuildRequires. Had to hard-code
Epoch in spec file in order to realize deps with yum-builddep.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: 07f46e8
Component: packaging
  • Loading branch information
andrewhsu committed Aug 12, 2018
1 parent 1bf6ceb commit 5b9122f
Showing 3 changed files with 27 additions and 12 deletions.
15 changes: 9 additions & 6 deletions components/packaging/rpm/fedora-28/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM fedora:28
RUN dnf -y upgrade
RUN dnf install -y @development-tools fedora-packager
RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel systemd-devel tar git cmake vim-common
FROM alpine:latest as golang
RUN apk add curl
ARG GO_VERSION
RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local

FROM fedora:28
ENV DISTRO fedora
ENV SUITE 28
RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS pkcs11 seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
RUN mkdir -p /go/src/github.com/docker && mkdir -p /go/src/github.com/opencontainers
COPY docker-ce.spec /root/rpmbuild/SPECS/docker-ce.spec
RUN dnf install -y rpm-build dnf-plugins-core
RUN dnf builddep -y /root/rpmbuild/SPECS/docker-ce.spec
RUN mkdir -p /go/src/github.com/docker /go/src/github.com/opencontainers
COPY --from=golang /usr/local/go /usr/local/go/
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]
15 changes: 9 additions & 6 deletions components/packaging/rpm/fedora-28/Dockerfile.x86_64
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM fedora:28
RUN dnf -y upgrade
RUN dnf install -y @development-tools fedora-packager
RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel systemd-devel tar git cmake vim-common
FROM alpine:latest as golang
RUN apk add curl
ARG GO_VERSION
RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local

FROM fedora:28
ENV DISTRO fedora
ENV SUITE 28
RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS pkcs11 seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
RUN mkdir -p /go/src/github.com/docker && mkdir -p /go/src/github.com/opencontainers
COPY docker-ce.spec /root/rpmbuild/SPECS/docker-ce.spec
RUN dnf install -y rpm-build dnf-plugins-core
RUN dnf builddep -y /root/rpmbuild/SPECS/docker-ce.spec
RUN mkdir -p /go/src/github.com/docker /go/src/github.com/opencontainers
COPY --from=golang /usr/local/go /usr/local/go/
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]
9 changes: 9 additions & 0 deletions components/packaging/rpm/fedora-28/docker-ce.spec
Original file line number Diff line number Diff line change
@@ -18,6 +18,15 @@ Packager: Docker <support@docker.com>
%global with_selinux 1
%global _missing_build_ids_terminate_build 0

BuildRequires: make
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: git
BuildRequires: glibc-static
BuildRequires: libtool-ltdl-devel
BuildRequires: libseccomp-devel
BuildRequires: device-mapper-devel
BuildRequires: btrfs-progs-devel
BuildRequires: pkgconfig(systemd)

# required packages on install

0 comments on commit 5b9122f

Please sign in to comment.