1+ FROM ubuntu:24.04
2+
3+ ARG DEVPROXY_VERSION=0.26.0-beta.1
4+ ARG USERNAME=devproxy
5+ ENV DEVPROXY_VERSION=${DEVPROXY_VERSION}
6+
7+ EXPOSE 8000 8897
8+
9+ LABEL name="dev-proxy/dev-proxy:${DEVPROXY_VERSION}" \
10+ description="Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path." \
11+ homepage="https://aka.ms/devproxy" \
12+ maintainers="Waldek Mastykarz <
[email protected] >, \
13+ Garry Trinder <
[email protected] >" \
14+ org.opencontainers.image.source=https://github.com/dotnet/dev-proxy \
15+ org.opencontainers.image.description="Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path." \
16+ org.opencontainers.image.licenses=MIT
17+
18+ WORKDIR /app
19+
20+ COPY ./bld /app/devproxy
21+
22+ RUN apt -y update && apt -y upgrade && \
23+ apt install -y \
24+ curl unzip && \
25+ apt -y clean && \
26+ rm -rf /var/lib/apt/lists/* && \
27+ # Create a new user
28+ useradd -ms /bin/bash ${USERNAME} && \
29+ echo "export PATH=$PATH:$(pwd)/devproxy" >> /home/${USERNAME}/.bashrc && \
30+ # Create a directory for the configuration
31+ mkdir -p /home/${USERNAME}/.config && \
32+ chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.config
33+
34+ # Prevents error "Couldn't find a valid ICU package" when running Dev Proxy
35+ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 \
36+ # Required for .NET to properly resolve SpecialFolder.ApplicationData
37+ XDG_DATA_HOME=/home/${USERNAME}/.config
38+
39+ VOLUME /config
40+ WORKDIR /config
41+
42+ USER ${USERNAME}
43+
44+ RUN /app/devproxy/devproxy cert ensure
45+
46+ ENTRYPOINT ["/app/devproxy/devproxy", "--ip-address", "0.0.0.0"]
0 commit comments