github.com/lyraproj/hiera@v1.0.0-rc4/Dockerfile (about)

     1  FROM golang:alpine as build_base
     2  
     3  WORKDIR /go/src/github.com/lyraproj/hiera
     4  COPY . .
     5  
     6  # Since alpine doesn't have gcc
     7  RUN apk add --no-cache gcc musl-dev openssl
     8  
     9  RUN go install ./...
    10  
    11  
    12  # Ensure that a plugin directory is present
    13  RUN mkdir -p plugin
    14  
    15  # Include external plugins. A prerequisite is that the plugin source is copied into the hiera/plugin directory
    16  # prior to the docker build.
    17  
    18  # Add plugin builds here...
    19  
    20  # hiera_terraform plugin
    21  # RUN (cd plugin/hiera_terraform && go build -o ../terraform_backend)
    22  
    23  # hiera_azure plugin
    24  # RUN (cd plugin/hiera_azure && go build -o ../azure_key_vault)
    25  
    26  # Create a new minimalisic image that doesn't contain the build environment and
    27  # copy the executable over
    28  FROM alpine
    29  COPY --from=build_base /go/bin/rest /bin/hieraserver
    30  RUN mkdir -p /hiera/plugin
    31  # COPY --from=build_base /go/src/github.com/lyraproj/hiera/plugin/* /hiera/plugin/
    32  
    33  # Configurable values for runtime overrides
    34  ENV port 8080
    35  ENV loglevel error
    36  ENV config /hiera/hiera.yaml
    37  
    38  CMD /bin/hieraserver --port ${port} --loglevel ${loglevel} --config ${config}