mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
Dockerfile: add a FEATURES build arg
This ARG allows to disable some optional features and it might be useful if you build the image yourself
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -14,16 +14,21 @@ RUN go mod download
|
|||||||
|
|
||||||
ARG COMMIT_SHA
|
ARG COMMIT_SHA
|
||||||
|
|
||||||
|
# This ARG allows to disable some optional features and it might be useful if you build the image yourself.
|
||||||
|
# For example you can disable S3 and GCS support like this:
|
||||||
|
# --build-arg FEATURES=nos3,nogcs
|
||||||
|
ARG FEATURES
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN set -xe && \
|
RUN set -xe && \
|
||||||
export COMMIT_SHA=${COMMIT_SHA:-$(git describe --always --dirty)} && \
|
export COMMIT_SHA=${COMMIT_SHA:-$(git describe --always --dirty)} && \
|
||||||
go build -ldflags "-s -w -X github.com/drakkan/sftpgo/version.commit=${COMMIT_SHA} -X github.com/drakkan/sftpgo/version.date=`date -u +%FT%TZ`" -v -o sftpgo
|
go build $(if [ -n "${FEATURES}" ]; then echo "-tags ${FEATURES}"; fi) -ldflags "-s -w -X github.com/drakkan/sftpgo/version.commit=${COMMIT_SHA} -X github.com/drakkan/sftpgo/version.date=`date -u +%FT%TZ`" -v -o sftpgo
|
||||||
|
|
||||||
|
|
||||||
FROM alpine:3.12
|
FROM alpine:3.12
|
||||||
|
|
||||||
RUN apk add --update --no-cache ca-certificates tzdata bash
|
RUN apk add --update --no-cache ca-certificates tzdata bash mailcap
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
@@ -37,7 +42,7 @@ RUN addgroup -g 1000 -S sftpgo
|
|||||||
RUN adduser -u 1000 -h /var/lib/sftpgo -s /sbin/nologin -G sftpgo -S -D -H sftpgo
|
RUN adduser -u 1000 -h /var/lib/sftpgo -s /sbin/nologin -G sftpgo -S -D -H sftpgo
|
||||||
|
|
||||||
# Install some optional packages used by SFTPGo features
|
# Install some optional packages used by SFTPGo features
|
||||||
RUN apk add --update --no-cache rsync git mailcap
|
RUN apk add --update --no-cache rsync git
|
||||||
|
|
||||||
# Override some configuration details
|
# Override some configuration details
|
||||||
ENV SFTPGO_CONFIG_DIR=/etc/sftpgo
|
ENV SFTPGO_CONFIG_DIR=/etc/sftpgo
|
||||||
|
|||||||
@@ -40,9 +40,10 @@ maintainer: "Nicola Murino <nicola.murino@gmail.com>"
|
|||||||
provides:
|
provides:
|
||||||
- sftpgo
|
- sftpgo
|
||||||
description: |
|
description: |
|
||||||
SFTPGo is a fully featured and highly configurable
|
Fully featured and highly configurable SFTP server.
|
||||||
SFTP server with optional FTP/S and WebDAV support.
|
SFTPGo has optional FTP/S and WebDAV support.
|
||||||
It can serve local filesystem, S3, GCS
|
It can serve local filesystem, S3 (Compatible) Object Storages
|
||||||
|
and Google Cloud Storage
|
||||||
vendor: "SFTPGo"
|
vendor: "SFTPGo"
|
||||||
homepage: "https://github.com/drakkan/sftpgo"
|
homepage: "https://github.com/drakkan/sftpgo"
|
||||||
license: "GPL-3.0"
|
license: "GPL-3.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user