Commit 9bdb8747 authored by Bruce Flynn's avatar Bruce Flynn
Browse files

use go modules, tweak docker image

parent e19a70a2
Pipeline #7836 passed with stage
in 31 seconds
FROM golang:1.9 AS build
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
WORKDIR /go/src/gitlab.ssec.wisc.edu/brucef/chart-server
FROM golang:1.13-alpine AS build
RUN apk add --no-cache git
WORKDIR /code
COPY . .
RUN dep ensure && ./build.sh
RUN ./build.sh
FROM debian:buster-slim
COPY --from=build /go/bin/chart-server .
ENTRYPOINT ["./chart-server"]
CMD ["$@"]
FROM alpine:3.10
# UID 1000
ARG uid=1000
COPY --from=build /code/chart-server /
COPY entrypoint.sh /
RUN mkdir /charts
RUN apk add --no-cache dumb-init
RUN adduser -DS -u $uid app
USER app
EXPOSE 8080
WORKDIR /tmp
ENTRYPOINT ["/entrypoint.sh"]
\ No newline at end of file
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/gorilla/context"
packages = ["."]
revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42"
version = "v1.1.1"
[[projects]]
name = "github.com/gorilla/handlers"
packages = ["."]
revision = "7e0847f9db758cdebd26c149d0ae9d5d0b9c98ce"
version = "v1.4.0"
[[projects]]
name = "github.com/gorilla/mux"
packages = ["."]
revision = "e3702bed27f0d39777b0b37b664b6280e8ef8fbf"
version = "v1.6.2"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
name = "github.com/spf13/pflag"
packages = ["."]
revision = "9a97c102cda95a86cec2345a6f09f55a939babf5"
version = "v1.0.2"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "f6087c0b85729f6281d53f35c3d177780a29d49c74ea6dfde0a7ad376af7e256"
solver-name = "gps-cdcl"
solver-version = 1
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.0"
[[constraint]]
name = "github.com/spf13/pflag"
version = "1.0.2"
[prune]
go-tests = true
unused-packages = true
[[constraint]]
name = "github.com/gorilla/mux"
version = "1.6.2"
#!/usr/bin/env bash
#!/usr/bin/env sh
ver=$(git describe)
sha=$(git rev-parse HEAD)
dt="$(date +%Y-%m-%d)T$(date +%H:%M:%S)Z"
buildStr="v${ver} (${dt})"
pkg=gitlab.ssec.wisc.edu/brucef/chart-server
go install -v --ldflags "-X 'main.buildStr=${buildStr}'" ${pkg}/...
go build -v --ldflags "-X 'main.buildStr=${buildStr}'" ${pkg}/...
#!/usr/bin/env sh
[[ -z $CHART_SVR_URL ]] && echo "CHART_SVR_URL is required" && exit 2
exec dumb-init -- /chart-server --dir=/charts
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment