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

Bug 1992673: Fix build #93

Merged
merged 3 commits into from
Aug 11, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions Dockerfile.art
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-8-etcd-golang-1.16 AS builder

COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app
RUN ls -lR $REMOTE_SOURCES_DIR
RUN cat $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env
RUN source $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env && GOFLAGS='-mod=readonly' GO_BUILD_FLAGS='-v' ./build.sh

RUN mkdir -p /go/src/go.etcd.io/
RUN ln -s $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app /go/src/go.etcd.io/etcd

# stage 2 (note: any changes should reflect in Dockerfile.rhel)
FROM registry.ci.openshift.org/ocp/4.9:base

ENTRYPOINT ["/usr/bin/etcd"]

COPY --from=builder /go/src/go.etcd.io/etcd/bin/etcd /usr/bin/
COPY --from=builder /go/src/go.etcd.io/etcd/bin/etcdctl /usr/bin/
COPY --from=builder /go/src/go.etcd.io/etcd/bin/discover-etcd-initial-cluster /usr/bin/

LABEL io.k8s.display-name="etcd server" \
io.k8s.description="etcd is a distributed key-value store which stores the persistent master state for Kubernetes and OpenShift." \
maintainer="Sam Batschelet <sbatsche@redhat.com>"
19 changes: 0 additions & 19 deletions Dockerfile.openshift

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ WORKDIR /go/src/go.etcd.io/etcd

COPY . .

RUN GOFLAGS=-mod=readonly ./build.sh
RUN GOFLAGS='-mod=readonly' GO_BUILD_FLAGS='-v' ./build.sh

# stage 2
# stage 2 (note: any changes should reflect in Dockerfile.art)
FROM registry.ci.openshift.org/ocp/4.9:base

ENTRYPOINT ["/usr/bin/etcd"]
Expand Down
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

GO_BUILD_FLAGS="${GO_BUILD_FLAGS} ${GOFLAGS:+-$GOFLAGS}"

source ./scripts/test_lib.sh

GIT_SHA=$(git rev-parse --short HEAD || echo "GitNotFound")
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ function tool_exists {
}

# Ensure gobin is available, as it runs majority of the tools
if ! command -v "gobin" >/dev/null; then
if ! command -v "gobin" >/dev/null && [[ ! "$GO_BUILD_FLAGS" =~ 'mod=readonly' ]]; then
run env GO111MODULE=off go get github.com/myitcv/gobin || exit 1
fi

Expand Down