This commit is contained in:
@@ -10,39 +10,42 @@ filter-syscalls = false
|
||||
substituters = http://ncps.nix-pull-through-cache.svc.cluster.local:80 https://cache.nixos.org
|
||||
EOF
|
||||
|
||||
RUN --mount=type=secret,id=cache_token NIX_CONFIG="extra-access-tokens = ncps.nix-pull-through-cache.svc.cluster.local=$(cat /run/secrets/cache_token)" cp "$(nix build nixpkgs#cacert --print-out-paths)/etc/ssl/certs/ca-bundle.crt" /tmp/ca-bundle.crt
|
||||
RUN --mount=type=secret,id=cache_token echo "list" && find /run
|
||||
RUN --mount=type=secret,id=cache_token echo "secret:" && cat /run/secrets/cache_token && echo "endsecret"
|
||||
|
||||
COPY . /tmp/build
|
||||
WORKDIR /tmp/build
|
||||
# RUN --mount=type=secret,id=cache_token NIX_CONFIG="extra-access-tokens = ncps.nix-pull-through-cache.svc.cluster.local=$(cat /run/secrets/cache_token)" cp "$(nix build nixpkgs#cacert --print-out-paths)/etc/ssl/certs/ca-bundle.crt" /tmp/ca-bundle.crt
|
||||
|
||||
RUN --mount=type=secret,id=cache_token NIX_CONFIG="extra-access-tokens = ncps.nix-pull-through-cache.svc.cluster.local=$(cat /run/secrets/cache_token)" nix build '.#docker_env'
|
||||
# COPY . /tmp/build
|
||||
# WORKDIR /tmp/build
|
||||
|
||||
# Export the built closure to a folder
|
||||
RUN mkdir /tmp/nix-store-closure
|
||||
RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure
|
||||
RUN ln -s $(readlink -f /tmp/build/result/bin/sh) /tmp/sh
|
||||
# RUN --mount=type=secret,id=cache_token NIX_CONFIG="extra-access-tokens = ncps.nix-pull-through-cache.svc.cluster.local=$(cat /run/secrets/cache_token)" nix build '.#docker_env'
|
||||
|
||||
# # Export the built closure to a folder
|
||||
# RUN mkdir /tmp/nix-store-closure
|
||||
# RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure
|
||||
# RUN ln -s $(readlink -f /tmp/build/result/bin/sh) /tmp/sh
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Runner
|
||||
#
|
||||
# #
|
||||
# # Runner
|
||||
# #
|
||||
|
||||
FROM scratch
|
||||
# FROM scratch
|
||||
|
||||
WORKDIR /app
|
||||
# WORKDIR /app
|
||||
|
||||
ENV PATH="$PATH:/app/bin"
|
||||
# ENV PATH="$PATH:/app/bin"
|
||||
|
||||
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt
|
||||
ENV NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt
|
||||
COPY --from=builder /tmp/ca-bundle.crt /etc/ssl/certs/ca-bundle.crt
|
||||
# ENV SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt
|
||||
# ENV NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt
|
||||
# COPY --from=builder /tmp/ca-bundle.crt /etc/ssl/certs/ca-bundle.crt
|
||||
|
||||
COPY --from=builder /tmp/nix-store-closure /nix/store
|
||||
COPY --from=builder /tmp/build/result /app
|
||||
COPY --from=builder /tmp/sh /bin/sh
|
||||
EXPOSE 8080
|
||||
#RUN addgroup web && adduser -D -G web web
|
||||
#&& install -d -D -o web -g web -m 700 /srv/http/public
|
||||
# RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
|
||||
CMD ["/app/bin/launch_nginx"]
|
||||
# COPY --from=builder /tmp/nix-store-closure /nix/store
|
||||
# COPY --from=builder /tmp/build/result /app
|
||||
# COPY --from=builder /tmp/sh /bin/sh
|
||||
# EXPOSE 8080
|
||||
# #RUN addgroup web && adduser -D -G web web
|
||||
# #&& install -d -D -o web -g web -m 700 /srv/http/public
|
||||
# # RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
|
||||
# CMD ["/app/bin/launch_nginx"]
|
||||
|
||||
Reference in New Issue
Block a user