Dockerfile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright 2018 The Kubernetes Authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. FROM k8s.gcr.io/kube-cross:v1.10.4-1 as build_k8s_1_10_sample_apiserver
  15. ENV GOPATH /go
  16. RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin
  17. ENV PATH $GOPATH/bin:$PATH
  18. # The e2e aggregator test was originally added in #50347 and is designed to test ability to run a 1.7
  19. # sample-apiserver in newer releases. please see e2e test named "Should be able to support the 1.7 Sample
  20. # API Server using the current Aggregator"
  21. RUN go get -d k8s.io/sample-apiserver \
  22. && cd ${GOPATH}/src/k8s.io/sample-apiserver \
  23. && git checkout --track origin/release-1.10 \
  24. && CGO_ENABLED=0 GOOS=linux GOARCH=BASEARCH go install .
  25. # for arm, go install uses go/bin/linux_arm, so just find the file and copy it to the root so
  26. # we can copy it out from this throw away container image from a standard location
  27. RUN find /go/bin -name sample-apiserver -exec cp {} / \;
  28. FROM BASEIMAGE
  29. COPY --from=build_k8s_1_10_sample_apiserver /sample-apiserver /sample-apiserver
  30. ENTRYPOINT ["/sample-apiserver"]