1
0
mirror of https://github.com/rancher/os.git synced 2025-06-23 05:27:03 +00:00
os/Dockerfile.dapper

79 lines
2.7 KiB
Docker
Raw Normal View History

FROM rancher/os-dapper-base
2015-07-23 13:53:01 +00:00
RUN apt-get update && \
apt-get -y install locales sudo vim less curl wget git rsync build-essential isolinux xorriso gccgo \
libblkid-dev libmount-dev libselinux1-dev cpio genisoimage qemu-kvm qemu python-pip ca-certificates pkg-config tox
ARG HOST_ARCH
ENV HOST_ARCH ${HOST_ARCH}
RUN ln -sf go-6 /usr/bin/go && mkdir -p /usr/local && cd /usr/local && \
wget -O - https://storage.googleapis.com/golang/go1.6.src.tar.gz | tar -xz && \
cd go/src && GOROOT_BOOTSTRAP=/usr GOARCH=${HOST_ARCH} GOHOSTARCH=${HOST_ARCH} ./make.bash
ENV PATH /usr/local/go/bin:$PATH
2015-07-23 13:53:01 +00:00
RUN mkdir -p /go/src /go/bin && chmod -R 777 /go
ENV GOPATH /go
ENV PATH /go/bin:$PATH
ARG HOST_DOCKER_BINARY_URL
ENV HOST_DOCKER_BINARY_URL ${HOST_DOCKER_BINARY_URL}
RUN wget -O - ${HOST_DOCKER_BINARY_URL} > /usr/local/bin/docker
RUN chmod +x /usr/local/bin/docker
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_SOURCE /go/src/github.com/rancher/os
ENV DAPPER_OUTPUT ./bin ./dist ./build/os-config.yml
ENV DAPPER_RUN_ARGS --privileged
ENV SHELL /bin/bash
WORKDIR ${DAPPER_SOURCE}
COPY .dockerignore.dapper .dockerignore
2016-02-28 19:17:03 +00:00
CMD make
ARG TOOLCHAIN
ENV TOOLCHAIN ${TOOLCHAIN}
RUN if [ "${TOOLCHAIN}" != "" ] && ! which ${TOOLCHAIN}-gcc; then \
apt-get install -y gcc-${TOOLCHAIN} g++-${TOOLCHAIN} \
;fi
RUN if [ "${TOOLCHAIN}" != "" ]; then \
apt-get update && \
cd /usr/local/src && \
2016-03-16 17:52:05 +00:00
for i in libselinux libsepol pcre3 util-linux; do \
apt-get build-dep -y $i && \
apt-get source -y $i \
;done \
;fi
RUN if [ "${TOOLCHAIN}" != "" ]; then \
cd /usr/local/src/pcre3-* && \
autoreconf && \
CC=${TOOLCHAIN}-gcc CXX=${TOOLCHAIN}-g++ ./configure --host=${TOOLCHAIN} --prefix=/usr/${TOOLCHAIN} && \
make -j$(nproc) && \
make install \
;fi
RUN if [ "${TOOLCHAIN}" != "" ]; then \
cd /usr/local/src/libselinux-* && \
CC=${TOOLCHAIN}-gcc CXX=${TOOLCHAIN}-g++ make CFLAGS=-Wall && \
2016-03-16 17:52:05 +00:00
make PREFIX=/usr/${TOOLCHAIN} DESTDIR=/usr/${TOOLCHAIN} install && \
cd /usr/local/src/libsepol-* && \
CC=${TOOLCHAIN}-gcc CXX=${TOOLCHAIN}-g++ make CFLAGS=-Wall && \
make PREFIX=/usr/${TOOLCHAIN} DESTDIR=/usr/${TOOLCHAIN} install \
;fi
RUN if [ "${TOOLCHAIN}" != "" ]; then \
cd /usr/local/src/util-linux-* && \
autoreconf && \
CC=${TOOLCHAIN}-gcc CXX=${TOOLCHAIN}-g++ ./configure --host=${TOOLCHAIN} --prefix=/usr/${TOOLCHAIN} \
--disable-all-programs \
--enable-libmount \
--enable-libblkid \
--enable-libuuid \
--enable-mount && \
make -j$(nproc) && \
make install \
;fi