webhookd/Dockerfile

59 lines
1.3 KiB
Docker
Raw Normal View History

#########################################
# Build stage
#########################################
2020-01-28 20:14:03 +00:00
FROM golang:1.13 AS builder
2014-09-23 18:21:43 +00:00
# Repository location
ARG REPOSITORY=github.com/ncarlier
2014-09-23 18:21:43 +00:00
# Artifact name
ARG ARTIFACT=webhookd
2014-09-23 18:21:43 +00:00
# Copy sources into the container
ADD . /go/src/$REPOSITORY/$ARTIFACT
2014-09-23 18:21:43 +00:00
# Set working directory
WORKDIR /go/src/$REPOSITORY/$ARTIFACT
2014-09-23 18:21:43 +00:00
# Build the binary
RUN make
2014-09-23 18:21:43 +00:00
#########################################
# Distribution stage
#########################################
FROM docker:dind
2014-09-23 18:21:43 +00:00
# Repository location
ARG REPOSITORY=github.com/ncarlier
2014-09-23 18:21:43 +00:00
# Artifact name
ARG ARTIFACT=webhookd
2014-09-23 18:21:43 +00:00
# Fix lib dep
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
2014-09-23 18:21:43 +00:00
# Install deps
RUN apk add --no-cache git openssh-client jq bash
2019-03-29 09:27:01 +00:00
# Install docker-compose
RUN COMPOSE_VERSION="1.23.2" \
&& apk add --no-cache \
py-pip \
&& pip install --no-cache-dir \
docker-compose==${COMPOSE_VERSION}
# Create folder structure
RUN mkdir -p /var/opt/webhookd/scripts /var/opt/webhookd/work
2018-01-15 10:51:15 +00:00
# Install binary and default scripts
COPY --from=builder /go/src/$REPOSITORY/$ARTIFACT/release/$ARTIFACT /usr/local/bin/$ARTIFACT
COPY --from=builder /go/src/$REPOSITORY/$ARTIFACT/scripts /var/opt/webhookd/scripts
COPY docker-entrypoint.sh /
# Define entrypoint
ENTRYPOINT ["/docker-entrypoint.sh"]
2014-09-23 18:21:43 +00:00
# Define command
CMD webhookd