Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for build with mock #710

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions rpm/SPECS/docker-ce-cli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Recommends: docker-scan-plugin(x86-64)
BuildRequires: make
BuildRequires: libtool-ltdl-devel
BuildRequires: git
%if 0%{?fedora} > 35 || 0%{?rhel} > 7
BuildRequires: golang
%endif

# conflicting packages
Conflicts: docker
Expand All @@ -67,10 +70,15 @@ depending on a particular stack or provider.
%setup -q -c -n src -a 0

%build
mkdir -p /go/src/github.com/docker
rm -f /go/src/github.com/docker/cli
ln -snf ${RPM_BUILD_DIR}/src/cli /go/src/github.com/docker/cli
pushd /go/src/github.com/docker/cli
go env -w GO111MODULE=off
export PREFIX=${RPM_BUILD_DIR}
export TMP_GOPATH="${RPM_BUILD_DIR}/go"
export GOPATH="${RPM_BUILD_DIR}/go"

mkdir -p ${RPM_BUILD_DIR}/go/src/github.com/docker
rm -f ${RPM_BUILD_DIR}/go/src/github.com/docker/cli
ln -snf ${RPM_BUILD_DIR}/src/cli ${RPM_BUILD_DIR}/go/src/github.com/docker/cli
pushd ${RPM_BUILD_DIR}/go/src/github.com/docker/cli
VERSION=%{_origversion} GITCOMMIT=%{_gitcommit_cli} GO_LINKMODE=dynamic ./scripts/build/binary && DISABLE_WARN_OUTSIDE_CONTAINER=1 make manpages # cli
popd

Expand Down
17 changes: 11 additions & 6 deletions rpm/SPECS/docker-ce-rootless-extras.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Requires: slirp4netns >= 0.4
Requires: fuse-overlayfs >= 0.7

BuildRequires: bash
%if 0%{?fedora} > 35 || 0%{?rhel} > 7
BuildRequires: golang
%endif

# conflicting packages
Conflicts: rootlesskit
Expand All @@ -35,20 +38,22 @@ Either VPNKit or slirp4netns (>= 0.4.0) needs to be installed separately.
%setup -q -c -n src -a 0

%build
export TMP_GOPATH="${RPM_BUILD_DIR}/go"
export PREFIX="${RPM_BUILD_DIR}/go"

export DOCKER_GITCOMMIT=%{_gitcommit_engine}
mkdir -p /go/src/github.com/docker
ln -snf ${RPM_BUILD_DIR}/src/engine /go/src/github.com/docker/docker
TMP_GOPATH="/go" ${RPM_BUILD_DIR}/src/engine/hack/dockerfile/install/install.sh rootlesskit dynamic
mkdir -p ${RPM_BUILD_DIR}/go/src/github.com/docker
ln -snf ${RPM_BUILD_DIR}/src/engine ${RPM_BUILD_DIR}/go/src/github.com/docker/docker
TMP_GOPATH="${RPM_BUILD_DIR}/go" ${RPM_BUILD_DIR}/src/engine/hack/dockerfile/install/install.sh rootlesskit dynamic

%check
/usr/local/bin/rootlesskit -v
${RPM_BUILD_ROOT}%{_bindir}/rootlesskit -v

%install
install -D -p -m 0755 engine/contrib/dockerd-rootless.sh ${RPM_BUILD_ROOT}%{_bindir}/dockerd-rootless.sh
install -D -p -m 0755 engine/contrib/dockerd-rootless-setuptool.sh ${RPM_BUILD_ROOT}%{_bindir}/dockerd-rootless-setuptool.sh
install -D -p -m 0755 /usr/local/bin/rootlesskit ${RPM_BUILD_ROOT}%{_bindir}/rootlesskit
install -D -p -m 0755 /usr/local/bin/rootlesskit-docker-proxy ${RPM_BUILD_ROOT}%{_bindir}/rootlesskit-docker-proxy
install -D -p -m 0755 ${RPM_BUILD_DIR}/go/rootlesskit ${RPM_BUILD_ROOT}%{_bindir}/rootlesskit
install -D -p -m 0755 ${RPM_BUILD_DIR}/go/rootlesskit-docker-proxy ${RPM_BUILD_ROOT}%{_bindir}/rootlesskit-docker-proxy

%files
%{_bindir}/dockerd-rootless.sh
Expand Down
25 changes: 16 additions & 9 deletions rpm/SPECS/docker-ce.spec
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ BuildRequires: selinux-policy-devel
BuildRequires: systemd-devel
BuildRequires: tar
BuildRequires: which
%if 0%{?fedora} > 35 || 0%{?rhel} > 7
BuildRequires: golang
%endif

# conflicting packages
Conflicts: docker
Expand Down Expand Up @@ -81,26 +84,30 @@ depending on a particular stack or provider.
%build

export DOCKER_GITCOMMIT=%{_gitcommit_engine}
mkdir -p /go/src/github.com/docker
ln -snf ${RPM_BUILD_DIR}/src/engine /go/src/github.com/docker/docker
go env -w GO111MODULE=off
export PREFIX=${RPM_BUILD_DIR}
export AUTO_GOPATH=1

mkdir -p ${RPM_BUILD_DIR}/go/src/github.com/docker
ln -snf ${RPM_BUILD_DIR}/src/engine ${RPM_BUILD_DIR}/go/src/github.com/docker/docker

pushd ${RPM_BUILD_DIR}/src/engine
TMP_GOPATH="/go" hack/dockerfile/install/install.sh tini
TMP_GOPATH="${RPM_BUILD_DIR}/go" hack/dockerfile/install/install.sh tini
VERSION=%{_origversion} PRODUCT=docker hack/make.sh dynbinary
popd

%check
ver="$(engine/bundles/dynbinary-daemon/dockerd --version)"; \
ver="$(${RPM_BUILD_DIR}/bundles/dynbinary-daemon/dockerd --version)"; \
test "$ver" = "Docker version %{_origversion}, build %{_gitcommit_engine}" && echo "PASS: daemon version OK" || (echo "FAIL: daemon version ($ver) did not match" && exit 1)

%install
install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/dockerd) ${RPM_BUILD_ROOT}%{_bindir}/dockerd
install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/docker-proxy) ${RPM_BUILD_ROOT}%{_bindir}/docker-proxy
install -D -p -m 0755 /usr/local/bin/docker-init ${RPM_BUILD_ROOT}%{_bindir}/docker-init
install -D -p -m 0755 $(readlink -f ${RPM_BUILD_DIR}/bundles/dynbinary-daemon/dockerd) ${RPM_BUILD_ROOT}%{_bindir}/dockerd
install -D -p -m 0755 $(readlink -f ${RPM_BUILD_DIR}/bundles/dynbinary-daemon/docker-proxy) ${RPM_BUILD_ROOT}%{_bindir}/docker-proxy
install -D -p -m 0755 ${RPM_BUILD_DIR}/docker-init ${RPM_BUILD_ROOT}%{_bindir}/docker-init

# install systemd scripts
install -D -m 0644 engine/contrib/init/systemd/docker.service ${RPM_BUILD_ROOT}%{_unitdir}/docker.service
install -D -m 0644 engine/contrib/init/systemd/docker.socket ${RPM_BUILD_ROOT}%{_unitdir}/docker.socket
install -D -m 0644 ${RPM_BUILD_DIR}/src/engine/contrib/init/systemd/docker.service ${RPM_BUILD_ROOT}%{_unitdir}/docker.service
install -D -m 0644 ${RPM_BUILD_DIR}/src/engine/contrib/init/systemd/docker.socket ${RPM_BUILD_ROOT}%{_unitdir}/docker.socket

%files
%{_bindir}/dockerd
Expand Down
3 changes: 3 additions & 0 deletions rpm/SPECS/docker-compose-plugin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Enhances: docker-ce-cli
%endif

BuildRequires: bash
%if 0%{?fedora} > 35 || 0%{?rhel} > 7
BuildRequires: golang
%endif

%description
Docker Compose (V2) plugin for the Docker CLI.
Expand Down
3 changes: 3 additions & 0 deletions rpm/SPECS/docker-scan-plugin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Enhances: docker-ce-cli
# TODO change once we support scan-plugin on other architectures
BuildArch: x86_64
BuildRequires: bash
%if 0%{?fedora} > 35 || 0%{?rhel} > 7
BuildRequires: golang
%endif

%description
Docker Scan plugin for the Docker CLI.
Expand Down
6 changes: 3 additions & 3 deletions rpm/fedora-34/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ COPY SPECS /root/rpmbuild/SPECS
# TODO change once we support scan-plugin on other architectures
RUN \
if [ "$(uname -m)" = "x86_64" ]; then \
dnf builddep -y /root/rpmbuild/SPECS/*.spec; \
dnf builddep -y --define 'fedora 34' /root/rpmbuild/SPECS/*.spec; \
else \
dnf builddep -y /root/rpmbuild/SPECS/docker-c*.spec; \
dnf builddep -y /root/rpmbuild/SPECS/docker-b*.spec; \
dnf builddep -y --define 'fedora 34' /root/rpmbuild/SPECS/docker-c*.spec; \
dnf builddep -y --define 'fedora 34' /root/rpmbuild/SPECS/docker-b*.spec; \
fi

COPY --from=golang /usr/local/go /usr/local/go
Expand Down
6 changes: 3 additions & 3 deletions rpm/fedora-35/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ COPY SPECS /root/rpmbuild/SPECS
# TODO change once we support scan-plugin on other architectures
RUN \
if [ "$(uname -m)" = "x86_64" ]; then \
dnf builddep -y /root/rpmbuild/SPECS/*.spec; \
dnf builddep -y --define 'fedora 35' /root/rpmbuild/SPECS/*.spec; \
else \
dnf builddep -y /root/rpmbuild/SPECS/docker-c*.spec; \
dnf builddep -y /root/rpmbuild/SPECS/docker-b*.spec; \
dnf builddep -y --define 'fedora 35' /root/rpmbuild/SPECS/docker-c*.spec; \
dnf builddep -y --define 'fedora 35' /root/rpmbuild/SPECS/docker-b*.spec; \
fi

COPY --from=golang /usr/local/go /usr/local/go
Expand Down
6 changes: 3 additions & 3 deletions rpm/fedora-36/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ COPY SPECS /root/rpmbuild/SPECS
# TODO change once we support scan-plugin on other architectures
RUN \
if [ "$(uname -m)" = "x86_64" ]; then \
dnf builddep -y /root/rpmbuild/SPECS/*.spec; \
dnf builddep -y --define 'fedora 36' /root/rpmbuild/SPECS/*.spec; \
else \
dnf builddep -y /root/rpmbuild/SPECS/docker-c*.spec; \
dnf builddep -y /root/rpmbuild/SPECS/docker-b*.spec; \
dnf builddep -y --define 'fedora 36' /root/rpmbuild/SPECS/docker-c*.spec; \
dnf builddep -y --define 'fedora 36' /root/rpmbuild/SPECS/docker-b*.spec; \
fi

COPY --from=golang /usr/local/go /usr/local/go
Expand Down