代码拉取完成,页面将自动刷新
# To build, run in root of tegola source tree:
#
# $ git clone git@github.com:go-spatial/tegola.git or git clone https://github.com/go-spatial/tegola.git
# $ cd tegola
# $ docker build -t tegola .
#
# To use with local files, add file data sources (i.e. Geopackages) and config as config.toml to a
# local directory and mount that directory as a volume at /opt/tegola_config/. Examples:
#
# To display command-line options available:
#
# $ docker run --rm tegola
#
# Example PostGIS use w/ http-based config:
#
# $ docker run -p 8080 tegola --config http://my-domain.com/config serve
#
# Example PostGIS use w/ local config:
# $ mkdir docker-config
# $ cp my-config-file docker-config/config.toml
# $ docker run -v /path/to/docker-config:/opt/tegola_config -p 8080 tegola serve
#
# Example gpkg use:
# $ mkdir docker-config
# $ cp my-config-file docker-config/config.toml
# $ cp my-db.gpkg docker-config/
# $ docker run -v /path/to/docker-config:/opt/tegola_config -p 8080 tegola serve
# Intermediary container for building
FROM golang:1.14.1-alpine3.11 AS build
ARG VERSION="Version Not Set"
ENV VERSION="${VERSION}"
# Only needed for CGO support at time of build, results in no noticable change in binary size
# incurs approximately 1:30 extra build time (1:54 vs 0:27) to install packages. Doesn't impact
# development as these layers are drawn from cache after the first build.
RUN apk update \
&& apk add musl-dev=1.1.24-r2 \
&& apk add gcc=9.3.0-r0
# Set up source for compilation
RUN mkdir -p /go/src/github.com/go-spatial/tegola
COPY . /go/src/github.com/go-spatial/tegola
# Build binary
RUN cd /go/src/github.com/go-spatial/tegola/cmd/tegola \
&& go build -v -ldflags "-w -X github.com/go-spatial/tegola/cmd/tegola/cmd.Version=${VERSION}" -gcflags "-N -l" -o /opt/tegola \
&& chmod a+x /opt/tegola
# Create minimal deployment image, just alpine & the binary
FROM alpine:3.11
RUN apk update \
&& apk add ca-certificates \
&& rm -rf /var/cache/apk/*
COPY --from=build /opt/tegola /opt/
WORKDIR /opt
ENTRYPOINT ["/opt/tegola"]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。