Skip to content

Commit

Permalink
Fix: fix build container error (kubeflow#17)
Browse files Browse the repository at this point in the history
Co-authored-by: whalecold <zhenglisheng@caicloud.io>
  • Loading branch information
whalecold and whalecold authored Oct 27, 2020
1 parent 6ee7f88 commit ccfe4fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions build/file-metricscollector/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
FROM cargo.caicloud.xyz/library/golang:1.12-security as build-env

# Copy in the go src
ADD . /root/go/src/github.com/kubeflow/katib
ADD . /go/src/github.com/kubeflow/katib

WORKDIR /root/go/src/github.com/kubeflow/katib/cmd/metricscollector/v1alpha3/file-metricscollector/
WORKDIR /go/src/github.com/kubeflow/katib/cmd/metricscollector/v1alpha3/file-metricscollector/

# Build
RUN if [ "$(uname -m)" = "ppc64le" ]; then \
Expand All @@ -17,5 +17,5 @@ RUN if [ "$(uname -m)" = "ppc64le" ]; then \

FROM cargo.caicloud.xyz/library/debian:stretch
WORKDIR /app
COPY --from=build-env /root/go/src/github.com/kubeflow/katib/cmd/metricscollector/v1alpha3/file-metricscollector/file-metricscollector .
COPY --from=build-env /go/src/github.com/kubeflow/katib/cmd/metricscollector/v1alpha3/file-metricscollector/file-metricscollector .
ENTRYPOINT ["./file-metricscollector"]
6 changes: 3 additions & 3 deletions build/katib-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
FROM cargo.caicloud.xyz/library/golang:1.12-security as build-env

# Copy in the go src
ADD . /root/go/src/github.com/kubeflow/katib
ADD . /go/src/github.com/kubeflow/katib

WORKDIR /root/go/src/github.com/kubeflow/katib/cmd/katib-controller
WORKDIR /go/src/github.com/kubeflow/katib/cmd/katib-controller
# Build
RUN if [ "$(uname -m)" = "ppc64le" ]; then \
CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -a -o katib-controller ./v1alpha3; \
Expand All @@ -17,5 +17,5 @@ RUN if [ "$(uname -m)" = "ppc64le" ]; then \
FROM cargo.caicloud.xyz/library/debian:stretch
WORKDIR /app

COPY --from=build-env /root/go/src/github.com/kubeflow/katib/cmd/katib-controller/katib-controller .
COPY --from=build-env /go/src/github.com/kubeflow/katib/cmd/katib-controller/katib-controller .
ENTRYPOINT ["./katib-controller"]
6 changes: 3 additions & 3 deletions build/katib-db-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM cargo.caicloud.xyz/library/golang:1.12-security as build-env
# The GOPATH in the image is /go.
ADD . /root/go/src/github.com/kubeflow/katib
WORKDIR /root/go/src/github.com/kubeflow/katib/cmd/db-manager
ADD . /go/src/github.com/kubeflow/katib
WORKDIR /go/src/github.com/kubeflow/katib/cmd/db-manager
RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \
apk --update add git gcc musl-dev && \
go build -o katib-db-manager ./v1alpha3; \
Expand All @@ -11,6 +11,6 @@ RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \

FROM cargo.caicloud.xyz/library/debian:stretch
WORKDIR /app
COPY --from=build-env /root/go/src/github.com/kubeflow/katib/cmd/db-manager/katib-db-manager /app/
COPY --from=build-env /go/src/github.com/kubeflow/katib/cmd/db-manager/katib-db-manager /app/
ENTRYPOINT ["./katib-db-manager"]
CMD ["-w", "kubernetes"]

0 comments on commit ccfe4fc

Please sign in to comment.