console.dockerfile 990 B

12345678910111213141516171819202122232425262728293031323334
  1. ARG COREVERS=3.1
  2. FROM mcr.microsoft.com/dotnet/sdk:$COREVERS AS build
  3. ARG TZ=Europe/London
  4. ARG USE_SEQ=0
  5. WORKDIR /App
  6. COPY res/id_rsa /root/.ssh/
  7. RUN touch /root/.ssh/known_hosts
  8. RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y openssh-client
  9. RUN ssh-keyscan -T 60 bitbucket.org >> /root/.ssh/known_hosts
  10. RUN chmod 600 /root/.ssh/*
  11. COPY res/appsettings.sh .
  12. COPY res/nuget.config .
  13. ADD res/nuget.tgz /
  14. RUN ln -sf /usr/share/zoneinfo/$TZ /etc/locacltime \
  15. && echo $TZ > /etc/timezone
  16. ARG PROJ
  17. ARG DIR
  18. ARG BRANCH
  19. RUN git clone git@bitbucket.org:globalprocessing/$PROJ.git --single-branch --branch $BRANCH
  20. WORKDIR /App/$PROJ/$DIR
  21. RUN /bin/bash /App/appsettings.sh
  22. RUN dotnet restore
  23. RUN dotnet publish -c Release -o /App/out
  24. RUN echo "dotnet `basename $DIR`.dll \$@" > /App/out/start.sh
  25. FROM mcr.microsoft.com/dotnet/runtime:$COREVERS
  26. WORKDIR /App
  27. COPY --from=build /App/out .
  28. COPY --from=build /etc/timezone /etc/localtime /etc/
  29. ENTRYPOINT ["sh", "start.sh"]