corso/build/Dockerfile
Niraj Tolia ffcc248398
Correctly add CA certificates (#2542)
## Description

This ensures that the CA certificates are not from some random version of Alpine but from the version we are using as a base image.

## Does this PR need a docs update or release note?

- [x]  No 

## Type of change

- [x] 🐛 Bugfix
- [x] 🧹 Tech Debt/Cleanup

## Issue(s)

* #2529 

## Test Plan

- [x] 💪 Manual
2023-02-16 07:40:00 +00:00

30 lines
965 B
Docker

FROM golang:1.19-alpine as builder
WORKDIR /go/src/app
COPY src .
ARG CORSO_BUILD_LDFLAGS=""
RUN go build -o corso -ldflags "$CORSO_BUILD_LDFLAGS"
FROM alpine:3.17
LABEL org.opencontainers.image.title="Corso"
LABEL org.opencontainers.image.description="Free, Secure, and Open-Source Backup for Microsoft 365"
LABEL org.opencontainers.image.url="https://github.com/alcionai/corso"
LABEL org.opencontainers.image.source="https://github.com/alcionai/corso"
LABEL org.opencontainers.image.vendor="Alcion, Inc."
COPY --from=builder /go/src/app/corso /corso
RUN apk add --no-cache ca-certificates
ENV CORSO_HOME=/app/corso
ENV CORSO_CONFIG_DIR=$CORSO_HOME \
KOPIA_CONFIG_PATH=$CORSO_HOME/kopia/config/repository.config \
KOPIA_LOG_DIR=$CORSO_HOME/kopia/logs \
KOPIA_CACHE_DIRECTORY=$CORSO_HOME/kopia/cache \
RCLONE_CONFIG=$CORSO_HOME/kopia/rclone/rclone.conf \
KOPIA_PERSIST_CREDENTIALS_ON_CONNECT=false \
KOPIA_CHECK_FOR_UPDATES=false
ENTRYPOINT ["/corso"]