update dockerfile versions
This commit is contained in:
+15
-10
@@ -7,13 +7,16 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Create a stage for building the application.
|
# Create a stage for building the application.
|
||||||
|
|
||||||
ARG RUST_VERSION=1.89.0
|
ARG RUST_VERSION=1
|
||||||
FROM rust:${RUST_VERSION}-slim-bullseye AS build
|
FROM rust:${RUST_VERSION}-slim AS build
|
||||||
ARG TARGET=release
|
ARG TARGET=release
|
||||||
ARG APP_NAME=urls-txt
|
ARG APP_NAME=urls-txt
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN rm /var/lib/dpkg/info/libc-bin.* && apt-get clean && apt-get update && apt install libc-bin
|
RUN rm /var/lib/dpkg/info/libc-bin.* \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y libc-bin
|
||||||
|
|
||||||
# Build the application.
|
# Build the application.
|
||||||
# Leverage a cache mount to /usr/local/cargo/registry/
|
# Leverage a cache mount to /usr/local/cargo/registry/
|
||||||
@@ -46,9 +49,13 @@ EOF
|
|||||||
# most recent version of that tag when you build your Dockerfile. If
|
# most recent version of that tag when you build your Dockerfile. If
|
||||||
# reproducability is important, consider using a digest
|
# reproducability is important, consider using a digest
|
||||||
# (e.g., debian@sha256:ac707220fbd7b67fc19b112cee8170b41a9e97f703f588b2cdbbcdcecdd8af57).
|
# (e.g., debian@sha256:ac707220fbd7b67fc19b112cee8170b41a9e97f703f588b2cdbbcdcecdd8af57).
|
||||||
FROM debian:bullseye-slim AS final
|
FROM debian:trixie-slim AS final
|
||||||
RUN rm /var/lib/dpkg/info/libc-bin.* && apt-get clean && apt-get update && apt install libc-bin
|
|
||||||
ENV URLS_TXT_BIND_ADDRESS=0.0.0.0:3000
|
RUN rm /var/lib/dpkg/info/libc-bin.* \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get upgrade -y \
|
||||||
|
&& apt-get install -y libc-bin adduser
|
||||||
|
|
||||||
# Create a non-privileged user that the app will run under.
|
# Create a non-privileged user that the app will run under.
|
||||||
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/ #user
|
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/ #user
|
||||||
@@ -63,11 +70,9 @@ RUN adduser \
|
|||||||
appuser
|
appuser
|
||||||
USER appuser
|
USER appuser
|
||||||
|
|
||||||
# Copy the executable from the "build" stage.
|
|
||||||
COPY --from=build /bin/server /bin/
|
COPY --from=build /bin/server /bin/
|
||||||
|
|
||||||
# Expose the port that the application listens on.
|
EXPOSE 3000
|
||||||
EXPOSE 8000
|
|
||||||
|
|
||||||
# What the container should run when it is started.
|
ENV URLS_TXT_BIND_ADDRESS=0.0.0.0:3000
|
||||||
CMD ["/bin/server", "/urls.txt"]
|
CMD ["/bin/server", "/urls.txt"]
|
||||||
|
|||||||
Reference in New Issue
Block a user