1
- FROM fedora:latest AS builder
1
+ FROM fedora:latest
2
2
WORKDIR /app
3
3
# https://github.com/gsauthof/pe-util
4
4
RUN dnf install -y \
@@ -7,8 +7,8 @@ RUN dnf install -y \
7
7
gcc \
8
8
make \
9
9
cmake \
10
- gcc-c++ boost-devel \
11
- && yum clean all
10
+ gcc-c++ \
11
+ boost-devel
12
12
13
13
RUN git clone https://github.com/gsauthof/pe-util.git \
14
14
&& cd pe-util \
@@ -18,4 +18,61 @@ RUN git clone https://github.com/gsauthof/pe-util.git \
18
18
&& cmake .. -DCMAKE_BUILD_TYPE=Release \
19
19
&& make VERBOSE=1
20
20
21
- CMD ["ls" , "-al" ]
21
+ RUN cp /app/pe-util/build/peldd /usr/bin/
22
+
23
+ ADD package.sh /usr/bin/package.sh
24
+ RUN chmod 755 /usr/bin/package.sh
25
+
26
+
27
+ RUN dnf install -y \
28
+ mingw32-gcc \
29
+ mingw32-freetype \
30
+ mingw32-cairo \
31
+ mingw32-harfbuzz \
32
+ mingw32-pango \
33
+ mingw32-poppler \
34
+ mingw32-gtk3 \
35
+ mingw32-winpthreads-static \
36
+ mingw32-glib2-static \
37
+ gcc \
38
+ zip \
39
+ && dnf clean all -y
40
+
41
+ RUN useradd -ms /bin/bash rust
42
+
43
+ # User tasks
44
+ USER rust
45
+
46
+ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=stable --profile=minimal
47
+
48
+ RUN . ~/.cargo/env && \
49
+ rustup target add i686-pc-windows-gnu && \
50
+ rustup target add x86_64-pc-windows-gnu
51
+
52
+ ADD cargo.config /home/rust/.cargo/config
53
+
54
+ ENV PKG_CONFIG_ALLOW_CROSS=1
55
+ ENV PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig/
56
+ ENV GTK_INSTALL_PATH=/usr/i686-w64-mingw32/sys-root/mingw/
57
+ VOLUME /home/rust/src
58
+ WORKDIR /home/rust/src
59
+
60
+ # This calls the final job
61
+ # # Create a package.sh in your project folder overrides the one in /usr/bin/ (don't forget `chmod +x packages.sh`)
62
+ CMD ["package.sh" ]
63
+
64
+ # Usage:
65
+ # # Build the container
66
+ # ```
67
+ # # docker build . -t rust-crosspile
68
+ # ```
69
+
70
+ # # Now build a image **in your source directory!**. Your sources are mounted as a docker VOLUME
71
+ # ```
72
+ # # docker create -v `pwd`:/home/rust/src --name PROJECT-build rust-crosspile:latest
73
+ # ```
74
+
75
+ # From now on everytime you want conpile and pack the latest version call `docker start`
76
+ # # docker start -ai PROJECT-build
77
+
78
+ # # docker rm PROJECT-build
0 commit comments