Dockerfile.centos 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Copyright 2021 EMQ Technologies Co., Ltd.
  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 centos:7
  15. RUN yum install -y make wget git which rpm-build gcc
  16. ARG GO_VERSION
  17. RUN case $(arch) in \
  18. x86_64) \
  19. case $(getconf LONG_BIT) in \
  20. 64) \
  21. ARCH=amd64; \
  22. yum install -y epel-release; \
  23. yum install -y upx \
  24. ;; \
  25. 32) ARCH=386;; \
  26. esac \
  27. ;; \
  28. aarch64) \
  29. ARCH=arm64 \
  30. ;; \
  31. arm) \
  32. ARCH=armv6l \
  33. ;; \
  34. ppc64le) \
  35. ARCH=ppc64le\
  36. ;; \
  37. s390x) \
  38. ARCH=s390x \
  39. ;; \
  40. esac \
  41. && wget --no-verbose https://golang.org/dl/go$GO_VERSION.linux-$ARCH.tar.gz \
  42. && tar -C /usr/local -xzf go$GO_VERSION.linux-$ARCH.tar.gz
  43. ENV PATH=$PATH:/usr/local/go/bin