Dockerfile.dapper 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. FROM ubuntu:16.04
  2. # FROM arm64=aarch64/ubuntu:16.04
  3. # get the apt-cacher proxy set
  4. ARG APTPROXY=
  5. RUN echo "Acquire::http { Proxy \"$APTPROXY\"; };" >> /etc/apt/apt.conf.d/01proxy \
  6. && cat /etc/apt/apt.conf.d/01proxy \
  7. && apt-get update \
  8. && apt-get install -y --no-install-recommends \
  9. build-essential \
  10. ca-certificates \
  11. cpio \
  12. curl \
  13. dosfstools \
  14. gccgo \
  15. genisoimage \
  16. gettext \
  17. git \
  18. isolinux \
  19. less \
  20. libblkid-dev \
  21. libmount-dev \
  22. libselinux1-dev \
  23. locales \
  24. module-init-tools \
  25. mtools \
  26. openssh-client \
  27. pkg-config \
  28. qemu \
  29. qemu-kvm \
  30. rsync \
  31. sudo \
  32. syslinux-common \
  33. vim \
  34. wget \
  35. xorriso \
  36. xz-utils \
  37. telnet
  38. ########## Dapper Configuration #####################
  39. ENV DAPPER_ENV VERSION DEV_BUILD RUNTEST DEBUG APTPROXY ENGINE_REGISTRY_MIRROR KERNEL_CHECK APPEND_SYSTEM_IMAGES APPEND_USER_IMAGES
  40. ENV DAPPER_DOCKER_SOCKET true
  41. ENV DAPPER_SOURCE /go/src/github.com/rancher/os
  42. ENV DAPPER_OUTPUT ./bin ./dist ./build/initrd ./build/kernel
  43. ENV DAPPER_RUN_ARGS --privileged
  44. ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
  45. ENV SHELL /bin/bash
  46. WORKDIR ${DAPPER_SOURCE}
  47. ########## General Configuration #####################
  48. ARG DAPPER_HOST_ARCH=amd64
  49. ARG HOST_ARCH=${DAPPER_HOST_ARCH}
  50. ARG ARCH=${HOST_ARCH}
  51. ARG OS_REPO=rancher
  52. ARG HOSTNAME_DEFAULT=rancher
  53. ARG DISTRIB_ID=RancherOS
  54. ARG SELINUX_POLICY_URL=https://github.com/rancher/refpolicy/releases/download/v0.0.3/policy.29
  55. ARG KERNEL_VERSION=4.14.85-rancher
  56. ARG KERNEL_URL_amd64=https://github.com/rancher/os-kernel/releases/download/v${KERNEL_VERSION}/linux-${KERNEL_VERSION}-x86.tar.gz
  57. ARG KERNEL_URL_arm64=https://github.com/rancher/os-kernel/releases/download/v${KERNEL_VERSION}/linux-${KERNEL_VERSION}-arm64.tar.gz
  58. ARG BUILD_DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3
  59. ARG BUILD_DOCKER_URL_arm64=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm64
  60. ARG OS_RELEASES_YML=https://releases.rancher.com/os
  61. ARG OS_SERVICES_REPO=https://raw.githubusercontent.com/${OS_REPO}/os-services
  62. ARG IMAGE_NAME=${OS_REPO}/os
  63. ARG OS_CONSOLE=default
  64. ARG OS_AUTOFORMAT=false
  65. ARG OS_BASE_URL_amd64=https://github.com/rancher/os-base/releases/download/v2018.02.11-1/os-base_amd64.tar.xz
  66. ARG OS_BASE_URL_arm64=https://github.com/rancher/os-base/releases/download/v2018.02.11-1/os-base_arm64.tar.xz
  67. ARG OS_INITRD_BASE_URL_amd64=https://github.com/rancher/os-initrd-base/releases/download/v2018.02.11-1/os-initrd-base-amd64.tar.gz
  68. ARG OS_INITRD_BASE_URL_arm64=https://github.com/rancher/os-initrd-base/releases/download/v2018.02.11-1/os-initrd-base-arm64.tar.gz
  69. ARG SYSTEM_DOCKER_VERSION=17.06-ros6
  70. ARG SYSTEM_DOCKER_URL_amd64=https://github.com/rancher/os-system-docker/releases/download/${SYSTEM_DOCKER_VERSION}/docker-amd64-${SYSTEM_DOCKER_VERSION}.tgz
  71. ARG SYSTEM_DOCKER_URL_arm64=https://github.com/rancher/os-system-docker/releases/download/${SYSTEM_DOCKER_VERSION}/docker-arm64-${SYSTEM_DOCKER_VERSION}.tgz
  72. ARG USER_DOCKER_VERSION=18.06.1-1
  73. ARG USER_DOCKER_ENGINE_VERSION=docker-18.06.1-ce
  74. ARG AZURE_SERVICE=false
  75. ARG PROXMOXVE_SERVICE=false
  76. ######################################################
  77. # Set up environment and export all ARGS as ENV
  78. ENV ARCH=${ARCH} \
  79. HOST_ARCH=${HOST_ARCH}
  80. ENV BUILD_DOCKER_URL=BUILD_DOCKER_URL_${ARCH} \
  81. BUILD_DOCKER_URL_amd64=${BUILD_DOCKER_URL_amd64} \
  82. BUILD_DOCKER_URL_arm64=${BUILD_DOCKER_URL_arm64} \
  83. DAPPER_HOST_ARCH=${DAPPER_HOST_ARCH} \
  84. DISTRIB_ID=${DISTRIB_ID} \
  85. DOWNLOADS=/usr/src/downloads \
  86. GOPATH=/go \
  87. GO_VERSION=1.8.5 \
  88. GOARCH=$ARCH \
  89. HOSTNAME_DEFAULT=${HOSTNAME_DEFAULT} \
  90. IMAGE_NAME=${IMAGE_NAME} \
  91. KERNEL_VERSION=${KERNEL_VERSION} \
  92. KERNEL_URL=KERNEL_URL_${ARCH} \
  93. KERNEL_URL_amd64=${KERNEL_URL_amd64} \
  94. KERNEL_URL_arm64=${KERNEL_URL_arm64} \
  95. OS_BASE_URL=OS_BASE_URL_${ARCH} \
  96. OS_BASE_URL_amd64=${OS_BASE_URL_amd64} \
  97. OS_BASE_URL_arm64=${OS_BASE_URL_arm64} \
  98. OS_INITRD_BASE_URL=OS_INITRD_BASE_URL_${ARCH} \
  99. OS_INITRD_BASE_URL_amd64=${OS_INITRD_BASE_URL_amd64} \
  100. OS_INITRD_BASE_URL_arm64=${OS_INITRD_BASE_URL_arm64} \
  101. OS_RELEASES_YML=${OS_RELEASES_YML} \
  102. OS_REPO=${OS_REPO} \
  103. OS_SERVICES_REPO=${OS_SERVICES_REPO} \
  104. OS_CONSOLE=${OS_CONSOLE} \
  105. OS_AUTOFORMAT=${OS_AUTOFORMAT} \
  106. REPO_VERSION=master \
  107. SELINUX_POLICY_URL=${SELINUX_POLICY_URL} \
  108. SYSTEM_DOCKER_URL=SYSTEM_DOCKER_URL_${ARCH} \
  109. SYSTEM_DOCKER_URL_amd64=${SYSTEM_DOCKER_URL_amd64} \
  110. SYSTEM_DOCKER_URL_arm64=${SYSTEM_DOCKER_URL_arm64} \
  111. USER_DOCKER_VERSION=${USER_DOCKER_VERSION} \
  112. USER_DOCKER_ENGINE_VERSION=${USER_DOCKER_ENGINE_VERSION} \
  113. AZURE_SERVICE=${AZURE_SERVICE} \
  114. PROXMOXVE_SERVICE=${PROXMOXVE_SERVICE}
  115. ENV PATH=${GOPATH}/bin:/usr/local/go/bin:$PATH
  116. RUN mkdir -p ${DOWNLOADS}
  117. # Download kernel
  118. RUN rm /bin/sh && ln -s /bin/bash /bin/sh
  119. RUN echo "... Downloading ${!KERNEL_URL}"; \
  120. if [ -n "${!KERNEL_URL}" ]; then \
  121. curl -fL ${!KERNEL_URL} > ${DOWNLOADS}/kernel.tar.gz \
  122. ;fi
  123. # Download SELinux Policy
  124. RUN curl -pfL ${SELINUX_POLICY_URL} > ${DOWNLOADS}/$(basename ${SELINUX_POLICY_URL})
  125. # Install Go
  126. RUN wget -O - https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz | tar -xzf - -C /usr/local && \
  127. go get github.com/rancher/trash
  128. RUN mkdir -p ${GOPATH}/src/golang.org/x && cd ${GOPATH}/src/golang.org/x/ && git clone https://github.com/golang/tools && \
  129. cd tools && git checkout 6adeb8aab2ded9eb693b831d5fd090c10a6ebdfa -b temp && go get golang.org/x/lint/golint
  130. # Install Host Docker
  131. RUN curl -fL ${!BUILD_DOCKER_URL} > /usr/bin/docker && \
  132. chmod +x /usr/bin/docker
  133. # Install dapper
  134. RUN curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m | sed 's/arm.*/arm/'` > /usr/bin/dapper && \
  135. chmod +x /usr/bin/dapper
  136. RUN cd ${DOWNLOADS} && \
  137. curl -pfL ${!OS_BASE_URL} | tar xvJf -
  138. ENTRYPOINT ["./scripts/entry"]
  139. CMD ["ci"]