Dockerfile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Licensed to the Apache Software Foundation (ASF) under one or more
  2. # contributor license agreements. See the NOTICE file distributed with
  3. # this work for additional information regarding copyright ownership.
  4. # The ASF licenses this file to You under the Apache License, Version 2.0
  5. # (the "License"); you may not use this file except in compliance with
  6. # the License. You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. FROM alpine
  16. RUN apk add --update --no-cache bash alpine-sdk maven grep openjdk8 py-pip rsync procps autoconf automake libtool findutils
  17. #Install real glibc
  18. RUN apk --no-cache add ca-certificates wget && \
  19. wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
  20. wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk && \
  21. apk add glibc-2.28-r0.apk
  22. #Install protobuf
  23. RUN mkdir -p /usr/local/src/ && \
  24. cd /usr/local/src/ && \
  25. wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz && \
  26. tar xvf protobuf-2.5.0.tar.gz && \
  27. cd protobuf-2.5.0 && \
  28. ./autogen.sh && \
  29. ./configure --prefix=/usr && \
  30. make && \
  31. make install && \
  32. protoc --version
  33. #Findbug install
  34. RUN mkdir -p /opt && \
  35. curl -sL https://sourceforge.net/projects/findbugs/files/findbugs/3.0.1/findbugs-3.0.1.tar.gz/download | tar -xz && \
  36. mv findbugs-* /opt/findbugs
  37. #Install apache-ant
  38. RUN mkdir -p /opt && \
  39. curl -sL 'https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=/ant/binaries/apache-ant-1.10.5-bin.tar.gz' | tar -xz && \
  40. mv apache-ant* /opt/ant
  41. #Install docker-compose
  42. RUN pip install docker-compose
  43. #Install pytest==2.8.7
  44. RUN pip install pytest==2.8.7
  45. ENV PATH=$PATH:/opt/findbugs/bin
  46. RUN addgroup -g 1000 default && \
  47. for i in $(seq 1 2000); do adduser jenkins$i -u $i -G default -h /tmp/ -H -D; done
  48. #This is a very huge local maven cache. Usually the mvn repository is not safe to be
  49. #shared between builds as concurrent installls are not handled very well
  50. #A simple workaround is to provide all the required 3rd party lib in the docker image
  51. #It will be cached by docker, and any additional dependency can be downloaded, artifacts
  52. #can be installed
  53. USER jenkins1000
  54. RUN cd /tmp && \
  55. git clone --depth=1 https://gitbox.apache.org/repos/asf/hadoop.git -b trunk && \
  56. cd /tmp/hadoop && \
  57. mvn package dependency:go-offline -DskipTests -P hdds -pl :hadoop-ozone-dist -am && \
  58. rm -rf /tmp/.m2/repository/org/apache/hadoop/*hdds* && \
  59. rm -rf /tmp/.m2/repository/org/apache/hadoop/*ozone* && \
  60. find /tmp/.m2/repository -exec chmod o+wx {} \;