2019-06-11 12:39:20 +00:00
|
|
|
FROM debian:buster-slim
|
|
|
|
|
2020-10-08 18:00:25 +00:00
|
|
|
ARG RUST_VER=1.47.0
|
2019-06-11 12:39:20 +00:00
|
|
|
|
2019-06-11 18:20:02 +00:00
|
|
|
RUN apt update -y -q \
|
|
|
|
&& apt upgrade -y -q \
|
|
|
|
&& apt install -y -q \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
cmake \
|
|
|
|
gcc \
|
|
|
|
make \
|
|
|
|
autotools-dev \
|
|
|
|
curl \
|
|
|
|
mingw-w64 \
|
|
|
|
mingw-w64-tools \
|
|
|
|
gcc-mingw-w64 \
|
|
|
|
binutils-mingw-w64 \
|
|
|
|
clang \
|
|
|
|
llvm \
|
|
|
|
git \
|
|
|
|
libxml2-dev \
|
|
|
|
libssl-dev \
|
|
|
|
liblzma-dev \
|
2019-08-23 22:29:28 +00:00
|
|
|
zlib1g-dev \
|
|
|
|
sqlite3 \
|
|
|
|
libsqlite3-0 \
|
2019-09-29 19:34:38 +00:00
|
|
|
libsqlite3-dev \
|
2019-07-04 21:32:55 +00:00
|
|
|
libzip-dev
|
2019-06-11 12:39:20 +00:00
|
|
|
|
|
|
|
#Build arguments
|
|
|
|
ARG osxcross_repo="tpoechtrager/osxcross"
|
2019-06-11 18:20:02 +00:00
|
|
|
ARG osxcross_revision="e0a171828a72a0d7ad4409489033536590008ebf"
|
|
|
|
ARG sdk_version="10.13"
|
2019-06-11 12:39:20 +00:00
|
|
|
|
2019-06-11 18:20:02 +00:00
|
|
|
RUN mkdir -p "/tmp/osxcross" \
|
|
|
|
&& cd "/tmp/osxcross" \
|
|
|
|
&& curl -sLo osxcross.tar.gz "https://codeload.github.com/${osxcross_repo}/tar.gz/${osxcross_revision}" \
|
|
|
|
&& tar --strip=1 -xzf osxcross.tar.gz \
|
|
|
|
&& rm -f osxcross.tar.gz
|
2019-06-11 12:39:20 +00:00
|
|
|
|
2019-06-11 18:20:02 +00:00
|
|
|
COPY MacOSX10.13.sdk.tar.xz /tmp/osxcross/tarballs/
|
|
|
|
|
|
|
|
RUN cd "/tmp/osxcross" \
|
|
|
|
&& UNATTENDED=1 ./build.sh \
|
|
|
|
&& mv target /usr/osxcross \
|
|
|
|
&& mv tools /usr/osxcross/ \
|
|
|
|
&& rm -rf /tmp/osxcross \
|
|
|
|
&& rm -rf "/usr/osxcross/SDK/MacOSX${sdk_version}.sdk/usr/share/man"
|
2019-06-11 12:39:20 +00:00
|
|
|
|
|
|
|
RUN useradd -ms /bin/bash rust
|
|
|
|
|
|
|
|
USER rust
|
|
|
|
WORKDIR /home/rust
|
|
|
|
|
|
|
|
RUN curl https://sh.rustup.rs -sSf -o rustup.sh && \
|
|
|
|
sh ./rustup.sh -y && \
|
|
|
|
rm rustup.sh
|
|
|
|
|
|
|
|
ENV PATH $PATH:/home/rust/.cargo/bin:/usr/osxcross/bin
|
2019-06-11 18:20:02 +00:00
|
|
|
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/osxcross/lib
|
2019-06-11 12:39:20 +00:00
|
|
|
|
2019-06-11 22:24:38 +00:00
|
|
|
RUN rustup default $RUST_VER
|
|
|
|
RUN rustup target add x86_64-pc-windows-gnu
|
|
|
|
RUN rustup target add x86_64-apple-darwin
|
|
|
|
RUN rustup component add clippy
|
|
|
|
RUN cargo install cargo-outdated
|
|
|
|
RUN cargo install cargo-audit
|
2019-08-23 22:29:28 +00:00
|
|
|
RUN cargo install cargo-web
|
2019-07-04 21:32:55 +00:00
|
|
|
RUN cargo install diesel_cli --no-default-features --features sqlite
|
2019-06-11 22:24:38 +00:00
|
|
|
|
2019-06-11 12:39:20 +00:00
|
|
|
RUN cp /usr/x86_64-w64-mingw32/lib/*crt2.o \
|
2019-08-19 16:30:36 +00:00
|
|
|
/home/rust/.rustup/toolchains/${RUST_VER}-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/
|
2019-06-11 12:39:20 +00:00
|
|
|
|
|
|
|
ADD mac-cargo /usr/local/bin/
|
|
|
|
ADD mac-c++ /usr/local/bin/
|
|
|
|
ADD mac-cc /usr/local/bin/
|
|
|
|
ADD win-cargo /usr/local/bin/
|
|
|
|
ADD win-cc /usr/local/bin
|
|
|
|
|
|
|
|
WORKDIR /workdir
|
|
|
|
|
2019-06-11 18:20:02 +00:00
|
|
|
CMD ["cargo", "build", "--release"]
|