-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.centos
54 lines (45 loc) · 2.13 KB
/
Dockerfile.centos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Use the official image as a parent image.
FROM centos:7 AS builder
# Add metadata to the image to describe which port the container is listening on at runtime.
EXPOSE 8080
RUN ["yum", "-y", "update"]
RUN ["yum", "-y", "install", "epel-release"]
RUN ["yum", "-y", "repolist"]
RUN ["yum", "-y", "install", "dpkg-devel", "dpkg-dev"]
RUN ["yum", "-y", "install", "wget"]
RUN ["yum", "-y", "install", "gcc"]
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.48.0
# copy pasted from the official rust docker image
RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='49c96f3f74be82f4752b8bffcf81961dea5e6e94ce1ccba94435f12e871c3bdb' ;; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='5a2be2919319e8778698fa9998002d1ec720efe7cb4f6ee4affb006b5e73f1be' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='d93ef6f91dab8299f46eef26a56c2d97c66271cea60bf004f2f088a86a697078' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e3d0ae3cfce5c6941f74fed61ca83e53d4cd2deb431b906cbd0687f246efede4' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.22.1/${rustArch}/rustup-init"; \
wget "$url"; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version;
# Install the OpenCL dev headers
RUN ["yum", "-y", "install", "ocl-icd-devel"]
# Set the working directory.
WORKDIR /usr/src/wasm-parser
# Copy the files from your host to your current location.
COPY . .
# Run the specified command within the container.
RUN [ "cargo", "build" ]
# copy the finished binary back
FROM scratch AS export-stage
COPY --from=builder /usr/src/wasm-parser/target/debug/wasm-parser /