I want to set the env MALLOC_CONF=prof:true
in docker image. I have tried like this:
<code>ENV MALLOC_CONF=prof:true
</code>
<code>ENV MALLOC_CONF=prof:true
</code>
ENV MALLOC_CONF=prof:true
also tried:
<code>RUN export MALLOC_CONF=prof:true
</code>
<code>RUN export MALLOC_CONF=prof:true
</code>
RUN export MALLOC_CONF=prof:true
then login into the docker image and check env like this:
<code>env|grep "MALLOC_CONF"
</code>
<code>env|grep "MALLOC_CONF"
</code>
env|grep "MALLOC_CONF"
both did not found the MALLOC_CONF
environment. This is the docker file:
<code>ARG BASE_IMAGE=dolphinjiang/rust-musl-builder:1.78.0
FROM ${BASE_IMAGE} AS builder
ADD --chown=rust:rust . ./
RUN git clone --depth 1 --branch 91d69b73e2fc9c65953c04debe0f06fbd1e51299 https://github.com/jlaurens/synctex.git
RUN cd synctex && gcc -c -fPIC *.c && gcc -shared *.o -o libsynctex_parser.so -lz
RUN cp libsynctex_parser.so ../src/so/
RUN RUSTFLAGS='-L ./src/so' cargo build --release
FROM alpine:3.18.2
LABEL maintainer="[email protected]"
WORKDIR /app
ENV ROCKET_ADDRESS=0.0.0.0
ENV MALLOC_CONF=prof:true
COPY --from=builder /home/rust/src/settings.toml /app
COPY --from=builder /home/rust/src/src/so/libsynctex_parser.so /app
COPY --from=builder /home/rust/src/src/so/libsynctex_parser.so /usr/lib/
COPY --from=builder /home/rust/src/log4rs.yaml /app
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/texhub-server /app/
RUN apk update && apk add curl websocat zlib zlib-dev openssl-dev openssl tzdata musl-locales
ENV TZ=Asia/Shanghai
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'export LC_ALL=en_GB.UTF-8' >> /etc/profile.d/locale.sh &&
sed -i 's|LANG=C.UTF-8|LANG=en_GB.UTF-8|' /etc/profile.d/locale.sh
RUN export MALLOC_CONF=prof:true
CMD ["./texhub-server"]
</code>
<code>ARG BASE_IMAGE=dolphinjiang/rust-musl-builder:1.78.0
FROM ${BASE_IMAGE} AS builder
ADD --chown=rust:rust . ./
RUN git clone --depth 1 --branch 91d69b73e2fc9c65953c04debe0f06fbd1e51299 https://github.com/jlaurens/synctex.git
RUN cd synctex && gcc -c -fPIC *.c && gcc -shared *.o -o libsynctex_parser.so -lz
RUN cp libsynctex_parser.so ../src/so/
RUN RUSTFLAGS='-L ./src/so' cargo build --release
FROM alpine:3.18.2
LABEL maintainer="[email protected]"
WORKDIR /app
ENV ROCKET_ADDRESS=0.0.0.0
ENV MALLOC_CONF=prof:true
COPY --from=builder /home/rust/src/settings.toml /app
COPY --from=builder /home/rust/src/src/so/libsynctex_parser.so /app
COPY --from=builder /home/rust/src/src/so/libsynctex_parser.so /usr/lib/
COPY --from=builder /home/rust/src/log4rs.yaml /app
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/texhub-server /app/
RUN apk update && apk add curl websocat zlib zlib-dev openssl-dev openssl tzdata musl-locales
ENV TZ=Asia/Shanghai
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'export LC_ALL=en_GB.UTF-8' >> /etc/profile.d/locale.sh &&
sed -i 's|LANG=C.UTF-8|LANG=en_GB.UTF-8|' /etc/profile.d/locale.sh
RUN export MALLOC_CONF=prof:true
CMD ["./texhub-server"]
</code>
ARG BASE_IMAGE=dolphinjiang/rust-musl-builder:1.78.0
FROM ${BASE_IMAGE} AS builder
ADD --chown=rust:rust . ./
RUN git clone --depth 1 --branch 91d69b73e2fc9c65953c04debe0f06fbd1e51299 https://github.com/jlaurens/synctex.git
RUN cd synctex && gcc -c -fPIC *.c && gcc -shared *.o -o libsynctex_parser.so -lz
RUN cp libsynctex_parser.so ../src/so/
RUN RUSTFLAGS='-L ./src/so' cargo build --release
FROM alpine:3.18.2
LABEL maintainer="[email protected]"
WORKDIR /app
ENV ROCKET_ADDRESS=0.0.0.0
ENV MALLOC_CONF=prof:true
COPY --from=builder /home/rust/src/settings.toml /app
COPY --from=builder /home/rust/src/src/so/libsynctex_parser.so /app
COPY --from=builder /home/rust/src/src/so/libsynctex_parser.so /usr/lib/
COPY --from=builder /home/rust/src/log4rs.yaml /app
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/texhub-server /app/
RUN apk update && apk add curl websocat zlib zlib-dev openssl-dev openssl tzdata musl-locales
ENV TZ=Asia/Shanghai
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'export LC_ALL=en_GB.UTF-8' >> /etc/profile.d/locale.sh &&
sed -i 's|LANG=C.UTF-8|LANG=en_GB.UTF-8|' /etc/profile.d/locale.sh
RUN export MALLOC_CONF=prof:true
CMD ["./texhub-server"]
Am I missing something? what should I do to set the image environmnet variable?