2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 19:31:35 +00:00

Hopefully last dockerfile changes for magick, rexiv2

This commit is contained in:
asonix 2020-06-15 20:16:12 -05:00
parent 64ee1ac8ad
commit 80d9387dbb
4 changed files with 14 additions and 29 deletions

View file

@ -1,17 +1,14 @@
FROM rustembedded/cross:x86_64-unknown-linux-gnu AS x86_64-builder FROM rustembedded/cross:x86_64-unknown-linux-gnu AS x86_64-builder
ARG UID=1000
ARG GID=1000
RUN \ RUN \
apt-get update && \ apt-get update && \
apt-get upgrade -y && \ apt-get upgrade -y && \
addgroup --gid "${GID}" build && \ addgroup --gid 991 build && \
adduser \ adduser \
--disabled-password \ --disabled-password \
--gecos "" \ --gecos "" \
--ingroup build \ --ingroup build \
--uid "${UID}" \ --uid 991 \
--home /opt/build \ --home /opt/build \
build build
@ -130,7 +127,7 @@ ENV \
RUN \ RUN \
mkdir -p ./src && \ mkdir -p ./src && \
echo 'fn main() { println!("Dummy") }' > ./src/main.rs && \ echo 'fn main() { println!("Dummy") }' > ./src/main.rs && \
cargo build && \ cargo build --release && \
rm -rf ./src rm -rf ./src
COPY src ./src/ COPY src ./src/
@ -138,11 +135,11 @@ COPY src ./src/
USER root USER root
RUN \ RUN \
chown -R build:build ./src && \ chown -R build:build ./src && \
rm -r ./target/debug/deps/pict_rs-* rm -r ./target/release/deps/pict_rs-*
USER build USER build
RUN cargo build --frozen RUN cargo build --release --frozen
FROM ubuntu:20.04 FROM ubuntu:20.04
@ -169,7 +166,7 @@ RUN \
pictrs pictrs
COPY --from=builder /imagemagick /imagemagick COPY --from=builder /imagemagick /imagemagick
COPY --from=builder /opt/build/repo/target/debug/$BINARY /usr/bin/$BINARY COPY --from=builder /opt/build/repo/target/release/$BINARY /usr/bin/$BINARY
VOLUME /mnt VOLUME /mnt
WORKDIR /opt/pictrs WORKDIR /opt/pictrs

View file

@ -1,17 +1,14 @@
FROM rustembedded/cross:x86_64-unknown-linux-gnu AS x86_64-builder FROM rustembedded/cross:x86_64-unknown-linux-gnu AS x86_64-builder
ARG UID=991
ARG GID=991
RUN \ RUN \
apt-get update && \ apt-get update && \
apt-get upgrade -y && \ apt-get upgrade -y && \
addgroup --gid "${GID}" build && \ addgroup --gid 991 build && \
adduser \ adduser \
--disabled-password \ --disabled-password \
--gecos "" \ --gecos "" \
--ingroup build \ --ingroup build \
--uid "${UID}" \ --uid 991 \
--home /opt/build \ --home /opt/build \
build build

View file

@ -1,17 +1,14 @@
FROM rustembedded/cross:arm-unknown-linux-gnueabihf AS arm32v7-builder FROM rustembedded/cross:arm-unknown-linux-gnueabihf AS arm32v7-builder
ARG UID=991
ARG GID=991
RUN \ RUN \
apt-get update && \ apt-get update && \
apt-get upgrade -y && \ apt-get upgrade -y && \
addgroup --gid "${GID}" build && \ addgroup --gid 991 build && \
adduser \ adduser \
--disabled-password \ --disabled-password \
--gecos "" \ --gecos "" \
--ingroup build \ --ingroup build \
--uid "${UID}" \ --uid 991 \
--home /opt/build \ --home /opt/build \
build build
@ -59,9 +56,6 @@ RUN \
libclang-dev \ libclang-dev \
clang \ clang \
libexpat1-dev:$ARCH && \ libexpat1-dev:$ARCH && \
ln -s /usr/lib/$TOOL/libpcre.so /usr/lib/$TOOL/libpcre.so.3 && \
ln -s /usr/lib/$TOOL/libz.so /usr/lib/$TOOL/libz.so.1 && \
ln -s /usr/lib/$TOOL/libexpatw.so /usr/lib/$TOOL/libexpat.so.1 && \
chown build:build ImageMagick.tar.gz chown build:build ImageMagick.tar.gz
@ -79,7 +73,7 @@ ENV \
PKG_CONFIG_PATH=/usr/lib/$TOOL/pkgconfig:/usr/lib/pkgconfig \ PKG_CONFIG_PATH=/usr/lib/$TOOL/pkgconfig:/usr/lib/pkgconfig \
LD_LIBRARY_PATH=/usr/lib/$TOOL \ LD_LIBRARY_PATH=/usr/lib/$TOOL \
LD_RUN_PATH=$LD_RUN_PATH:/usr/lib/$TOOL \ LD_RUN_PATH=$LD_RUN_PATH:/usr/lib/$TOOL \
LDFLAGS="$LDFLAGS -L/usr/lib/$TOOL -Wl,-rpath-link,/usr/lib/$TOOL" \ LDFLAGS="$LDFLAGS -L/lib/$TOOL -L/usr/lib/$TOOL -Wl,-rpath-link,/usr/lib/$TOOL" \
CFLAGS="$CFLAGS -I/usr/include/$TOOL -I/usr/$TOOL/include -I/usr/include" \ CFLAGS="$CFLAGS -I/usr/include/$TOOL -I/usr/$TOOL/include -I/usr/include" \
CPPFLAGS="$CPPFLAGS -I/usr/include/$TOOL -I/usr/$TOOL/include -I/usr/include" CPPFLAGS="$CPPFLAGS -I/usr/include/$TOOL -I/usr/$TOOL/include -I/usr/include"
@ -124,7 +118,7 @@ ENV \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/imagemagick/lib \ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/imagemagick/lib \
LD_RUN_PATH=$LD_RUN_PATH:/imagemagick/lib \ LD_RUN_PATH=$LD_RUN_PATH:/imagemagick/lib \
LDFLAGS="$LDFLAGS -L/imagemagick/lib" \ LDFLAGS="$LDFLAGS -L/imagemagick/lib" \
RUSTFLAGS="-L/usr/lib/$TOOL -C link-arg=-Wl,-rpath-link,/usr/lib/$TOOL" \ RUSTFLAGS="-L/usr/lib/$TOOL -L/lib/$TOOL -C link-arg=-Wl,-rpath-link,/usr/lib/$TOOL -C link-arg=-Wl,-rpath-link,/lib/$TOOL" \
IMAGE_MAGICK_LIB_DIRS=/imagemagick/lib \ IMAGE_MAGICK_LIB_DIRS=/imagemagick/lib \
IMAGE_MAGICK_INCLUDE_DIRS=/imagemagick/include/ImageMagick-7 \ IMAGE_MAGICK_INCLUDE_DIRS=/imagemagick/include/ImageMagick-7 \
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/imagemagick/lib/pkgconfig \ PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/imagemagick/lib/pkgconfig \

View file

@ -1,17 +1,14 @@
FROM rustembedded/cross:aarch64-unknown-linux-gnu AS aarch64-builder FROM rustembedded/cross:aarch64-unknown-linux-gnu AS aarch64-builder
ARG UID=991
ARG GID=991
RUN \ RUN \
apt-get update && \ apt-get update && \
apt-get upgrade -y && \ apt-get upgrade -y && \
addgroup --gid "${GID}" build && \ addgroup --gid 991 build && \
adduser \ adduser \
--disabled-password \ --disabled-password \
--gecos "" \ --gecos "" \
--ingroup build \ --ingroup build \
--uid "${UID}" \ --uid 991 \
--home /opt/build \ --home /opt/build \
build build