123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- FROM ubuntu:16.04
- # FROM arm64=aarch64/ubuntu:16.04
- # get the apt-cacher proxy set
- ARG APTPROXY=
- RUN echo "Acquire::http { Proxy \"$APTPROXY\"; };" >> /etc/apt/apt.conf.d/01proxy \
- && cat /etc/apt/apt.conf.d/01proxy \
- && apt-get update \
- && apt-get install -y --no-install-recommends \
- build-essential \
- ca-certificates \
- cpio \
- curl \
- dosfstools \
- gccgo \
- genisoimage \
- gettext \
- git \
- isolinux \
- less \
- libblkid-dev \
- libmount-dev \
- libselinux1-dev \
- locales \
- module-init-tools \
- mtools \
- openssh-client \
- pkg-config \
- qemu \
- qemu-kvm \
- rsync \
- sudo \
- syslinux-common \
- vim \
- wget \
- xorriso \
- xz-utils \
- telnet
- ########## Dapper Configuration #####################
- ENV DAPPER_ENV VERSION DEV_BUILD RUNTEST DEBUG APTPROXY ENGINE_REGISTRY_MIRROR
- ENV DAPPER_DOCKER_SOCKET true
- ENV DAPPER_SOURCE /go/src/github.com/rancher/os
- ENV DAPPER_OUTPUT ./bin ./dist ./build/initrd ./build/kernel
- ENV DAPPER_RUN_ARGS --privileged
- ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
- ENV SHELL /bin/bash
- WORKDIR ${DAPPER_SOURCE}
- ########## General Configuration #####################
- ARG DAPPER_HOST_ARCH=amd64
- ARG HOST_ARCH=${DAPPER_HOST_ARCH}
- ARG ARCH=${HOST_ARCH}
- ARG OS_REPO=rancher
- ARG HOSTNAME_DEFAULT=rancher
- ARG DISTRIB_ID=RancherOS
- ARG DOCKER_VERSION=1.11.2
- ARG DOCKER_PATCH_VERSION=v${DOCKER_VERSION}-ros1
- ARG DOCKER_BUILD_VERSION=1.10.3
- ARG DOCKER_BUILD_PATCH_VERSION=v${DOCKER_BUILD_VERSION}-ros1
- ARG SELINUX_POLICY_URL=https://github.com/rancher/refpolicy/releases/download/v0.0.3/policy.29
- ARG KERNEL_VERSION_amd64=4.14.73-rancher
- ARG KERNEL_URL_amd64=https://github.com/rancher/os-kernel/releases/download/v${KERNEL_VERSION_amd64}/linux-${KERNEL_VERSION_amd64}-x86.tar.gz
- ARG DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz
- ARG DOCKER_URL_arm64=https://github.com/rancher/docker/releases/download/${DOCKER_PATCH_VERSION}/docker-${DOCKER_VERSION}_arm64.tgz
- ARG BUILD_DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_BUILD_VERSION}
- ARG BUILD_DOCKER_URL_arm64=https://github.com/rancher/docker/releases/download/${DOCKER_BUILD_PATCH_VERSION}/docker-${DOCKER_BUILD_VERSION}_arm64
- ARG OS_RELEASES_YML=https://releases.rancher.com/os
- ARG OS_SERVICES_REPO=https://raw.githubusercontent.com/${OS_REPO}/os-services
- ARG IMAGE_NAME=${OS_REPO}/os
- ARG DFS_IMAGE=${OS_REPO}/docker:v${DOCKER_VERSION}-2
- ARG OS_BASE_URL_amd64=https://github.com/rancher/os-base/releases/download/v2018.02-4/os-base_amd64.tar.xz
- ARG OS_BASE_URL_arm64=https://github.com/rancher/os-base/releases/download/v2018.02-4/os-base_arm64.tar.xz
- ARG SYSTEM_DOCKER_VERSION=17.06-ros6
- ARG SYSTEM_DOCKER_URL_amd64=https://github.com/rancher/os-system-docker/releases/download/${SYSTEM_DOCKER_VERSION}/docker-amd64-${SYSTEM_DOCKER_VERSION}.tgz
- ARG SYSTEM_DOCKER_URL_arm64=https://github.com/rancher/os-system-docker/releases/download/${SYSTEM_DOCKER_VERSION}/docker-arm64-${SYSTEM_DOCKER_VERSION}.tgz
- ARG VMWARE_AUTOFORMAT=1
- ARG OPEN_VMTOOLS_VERSION=10.2.5-3
- ######################################################
- # Set up environment and export all ARGS as ENV
- ENV ARCH=${ARCH} \
- HOST_ARCH=${HOST_ARCH}
- ENV BUILD_DOCKER_URL=BUILD_DOCKER_URL_${ARCH} \
- BUILD_DOCKER_URL_amd64=${BUILD_DOCKER_URL_amd64} \
- BUILD_DOCKER_URL_arm64=${BUILD_DOCKER_URL_arm64} \
- DAPPER_HOST_ARCH=${DAPPER_HOST_ARCH} \
- DFS_IMAGE=${DFS_IMAGE} \
- DISTRIB_ID=${DISTRIB_ID} \
- DOCKER_PATCH_VERSION=${DOCKER_PATCH_VERSION} \
- DOCKER_URL=DOCKER_URL_${ARCH} \
- DOCKER_URL_amd64=${DOCKER_URL_amd64} \
- DOCKER_URL_arm64=${DOCKER_URL_arm64} \
- DOCKER_VERSION=${DOCKER_VERSION} \
- DOWNLOADS=/usr/src/downloads \
- GOPATH=/go \
- GO_VERSION=1.8.5 \
- GOARCH=$ARCH \
- HOSTNAME_DEFAULT=${HOSTNAME_DEFAULT} \
- IMAGE_NAME=${IMAGE_NAME} \
- KERNEL_VERSION=${KERNEL_VERSION_amd64} \
- KERNEL_URL=KERNEL_URL_${ARCH} \
- KERNEL_URL_amd64=${KERNEL_URL_amd64} \
- KERNEL_URL_arm64=${KERNEL_URL_arm64} \
- OS_BASE_SHA1=OS_BASE_SHA1_${ARCH} \
- OS_BASE_URL=OS_BASE_URL_${ARCH} \
- OS_BASE_URL_amd64=${OS_BASE_URL_amd64} \
- OS_BASE_URL_arm64=${OS_BASE_URL_arm64} \
- OS_RELEASES_YML=${OS_RELEASES_YML} \
- OS_REPO=${OS_REPO} \
- OS_SERVICES_REPO=${OS_SERVICES_REPO} \
- REPO_VERSION=master \
- SELINUX_POLICY_URL=${SELINUX_POLICY_URL} \
- SYSTEM_DOCKER_URL=SYSTEM_DOCKER_URL_${ARCH} \
- SYSTEM_DOCKER_URL_amd64=${SYSTEM_DOCKER_URL_amd64} \
- SYSTEM_DOCKER_URL_arm64=${SYSTEM_DOCKER_URL_arm64} \
- VMWARE_AUTOFORMAT=${VMWARE_AUTOFORMAT} \
- OPEN_VMTOOLS_VERSION=${OPEN_VMTOOLS_VERSION}
- ENV PATH=${GOPATH}/bin:/usr/local/go/bin:$PATH
- RUN mkdir -p ${DOWNLOADS}
- # Download kernel
- RUN rm /bin/sh && ln -s /bin/bash /bin/sh
- RUN echo "... Downloading ${!KERNEL_URL}"; \
- if [ -n "${!KERNEL_URL}" ]; then \
- curl -fL ${!KERNEL_URL} > ${DOWNLOADS}/kernel.tar.gz \
- ;fi
- # Download SELinux Policy
- RUN curl -pfL ${SELINUX_POLICY_URL} > ${DOWNLOADS}/$(basename ${SELINUX_POLICY_URL})
- # Install Go
- RUN wget -O - https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz | tar -xzf - -C /usr/local && \
- go get github.com/rancher/trash
- RUN mkdir -p ${GOPATH}/src/golang.org/x && cd ${GOPATH}/src/golang.org/x/ && git clone https://github.com/golang/tools && \
- cd tools && git checkout 6adeb8aab2ded9eb693b831d5fd090c10a6ebdfa -b temp && go get golang.org/x/lint/golint
- # Install Host Docker
- RUN curl -fL ${!BUILD_DOCKER_URL} > /usr/bin/docker && \
- chmod +x /usr/bin/docker
- # Install dapper
- RUN curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m | sed 's/arm.*/arm/'` > /usr/bin/dapper && \
- chmod +x /usr/bin/dapper
- RUN cd ${DOWNLOADS} && \
- curl -pfL ${!OS_BASE_URL} | tar xvJf -
- ENTRYPOINT ["./scripts/entry"]
- CMD ["ci"]
|