Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use LDFLAGS to set the default locations in docker #17501

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ENV GOPROXY ${GOPROXY:-direct}
ARG GITEA_VERSION
ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata timetzdata $TAGS"
ENV LDFLAGS="$LDFLAGS -X \"code.gitea.io/gitea/modules/setting.CustomPath=/data/gitea\" \
-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=/app/gitea\""
ARG CGO_EXTRA_CFLAGS

#Build deps
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile.rootless
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ ENV GOPROXY ${GOPROXY:-direct}
ARG GITEA_VERSION
ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata timetzdata $TAGS"
ENV LDFLAGS="$LDFLAGS -X \"code.gitea.io/gitea/modules/setting.CustomPath=/var/lib/gitea/custom\" \
-X \"code.gitea.io/gitea/modules/setting.CustomConf=/etc/gitea/conf.ini\" \
-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=/var/lib/gitea\""
ARG CGO_EXTRA_CFLAGS

#Build deps
Expand Down
2 changes: 1 addition & 1 deletion contrib/fhs-compliant-script/gitea
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ if [ -z "$APP_INI_SET" ]; then
fi

# Provide FHS compliant defaults to
exec -a "$0" GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" "$GITEA" $CONF_ARG "$@"
GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" $CONF_ARG "$@"