Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Dockerfile.machine-config-daemon
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ RUN WHAT=machine-config-daemon ./hack/build-go.sh

FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base
COPY --from=builder /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/machine-config-daemon /usr/bin/
RUN yum install -y util-linux && yum clean all && rm -rf /var/cache/yum/*
RUN if ! rpm -q util-linux; then yum install -y util-linux && yum clean all && rm -rf /var/cache/yum/*; fi
ENTRYPOINT ["/usr/bin/machine-config-daemon"]
10 changes: 10 additions & 0 deletions Dockerfile.machine-config-daemon.upstream
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder
WORKDIR /go/src/github.com/openshift/machine-config-operator
COPY . .
RUN WHAT=machine-config-daemon ./hack/build-go.sh

# Temporarily until the UBI base allows us to install util-linux without entitlements

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has nothing to do with UBI. This is because we only install one repo mirror that corresponds to our working set in CI. You can get this working locally by downloading:

https://github.com/openshift/release/blob/master/cluster/ci/config/prow/openshift/rpm-mirrors/ocp-4.0-default.repo
https://github.com/openshift/shared-secrets/blob/master/mirror/ops-mirror.pem

and putting them in the same directory, then using -v to imagebuilder or podman.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sent an email with instructions, you shouldn't need to add this.

@runcom runcom Mar 1, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Clayton for pointing this out

FROM registry.fedoraproject.org/fedora:29
COPY --from=builder /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/machine-config-daemon /usr/bin/
RUN if ! rpm -q util-linux; then yum install -y util-linux && yum clean all && rm -rf /var/cache/yum/*; fi
ENTRYPOINT ["/usr/bin/machine-config-daemon"]
10 changes: 8 additions & 2 deletions hack/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -eu

podman=${podman:-podman}

# Print errors to stderr
function print_error {
echo "ERROR: $1" >&2
Expand Down Expand Up @@ -41,6 +43,10 @@ if [ ${WHAT} == "all" ]; then
else
# Otherwise WHAT should be valid at this point
TOBUILD="Dockerfile.${WHAT}"
# See Dockerfile.machine-config-daemon.upstream for why this exists
if [ -f "$TOBUILD.upstream" ]; then
TOBUILD="${TOBUILD}.upstream"
fi
fi

# Check that the target is valid
Expand All @@ -63,5 +69,5 @@ fi
for IMAGE_TO_BUILD in $TOBUILD; do
NAME="${IMAGE_TO_BUILD#Dockerfile.}"
set -x
podman build -t "${NAME}:${VERSION}" -f "${IMAGE_TO_BUILD}" --no-cache
done
$podman build -t "${NAME}:${VERSION}" -f "${IMAGE_TO_BUILD}" --no-cache
done
4 changes: 3 additions & 1 deletion hack/cluster-push-prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

set -xeuo pipefail

podman=${podman:-podman}

oc -n openshift-cluster-version scale --replicas=0 deploy/cluster-version-operator
if ! oc get -n openshift-image-registry route/image-registry &>/dev/null; then
oc expose -n openshift-image-registry svc/image-registry
Expand All @@ -28,7 +30,7 @@ builder_secretid=$(oc get -n openshift-machine-config-operator secret | egrep '^
echo "podman login ${registry} ..."
set +x
secret="$(oc get -n openshift-machine-config-operator -o json secret/${builder_secretid} | jq -r '.data.token' | base64 -d)"
podman login --tls-verify=false -u unused -p "${secret}" "${registry}"
$podman login --tls-verify=false -u unused -p "${secret}" "${registry}"
set -x

# And allow everything to pull from our namespace
Expand Down
7 changes: 5 additions & 2 deletions hack/cluster-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

set -xeuo pipefail

podman=${podman:-podman}

do_build=1
if [ "${1:-}" = "-n" ]; then
do_build=0
Expand All @@ -20,9 +22,10 @@ WHAT=${WHAT:-machine-config-daemon}
LOCAL_IMGNAME=localhost/${WHAT}
REMOTE_IMGNAME=openshift-machine-config-operator/${WHAT}
if [ "${do_build}" = 1 ]; then
podman build -t "${LOCAL_IMGNAME}" -f Dockerfile.${WHAT} --no-cache
podman push --tls-verify=false "${LOCAL_IMGNAME}" ${registry}/${REMOTE_IMGNAME}
export WHAT
./hack/build-image.sh
fi
$podman push --tls-verify=false "${LOCAL_IMGNAME}" ${registry}/${REMOTE_IMGNAME}

digest=$(skopeo inspect --tls-verify=false docker://${registry}/${REMOTE_IMGNAME} | jq -r .Digest)
imageid=${REMOTE_IMGNAME}@${digest}
Expand Down