Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
use separate goreleaser config file to generate docker images based o…
…n alpine
- Loading branch information
1138-4EB
committed
Nov 6, 2019
1 parent
61ad1f2
commit 0edf35e
Showing
5 changed files
with
70 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
release: | ||
prerelease: true | ||
|
||
builds: | ||
- binary: dive | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.buildTime={{.Date}}`. | ||
|
||
dockers: | ||
- | ||
binaries: | ||
- dive | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- "wagoodman/dive:{{ .Tag }}" | ||
- "wagoodman/dive:v{{ .Major }}" | ||
- "wagoodman/dive:v{{ .Major }}.{{ .Minor }}" | ||
- "wagoodman/dive:latest" | ||
- "quay.io/wagoodman/dive:{{ .Tag }}" | ||
- "quay.io/wagoodman/dive:v{{ .Major }}" | ||
- "quay.io/wagoodman/dive:v{{ .Major }}.{{ .Minor }}" | ||
- "quay.io/wagoodman/dive:latest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
FROM debian:sid-slim | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
libdevmapper1.02.1 \ | ||
libgpgme11-dev \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& ln -s /lib/x86_64-linux-gnu/libdevmapper.so.1.02.1 /usr/lib/libdevmapper.so.1.02 | ||
ARG DOCKER_CLI_VERSION="19.03.1" | ||
RUN curl -L https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_CLI_VERSION.tgz | \ | ||
tar -xz --strip-component=1 -C /usr/local/bin/ docker/docker | ||
FROM alpine:3.10 | ||
COPY --from=wagoodman/dive:dev /usr/local/bin/docker /usr/local/bin/ | ||
COPY dive /usr/local/bin/ | ||
RUN apk add -U --no-cache gpgme device-mapper | ||
ENTRYPOINT ["/usr/local/bin/dive"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
cd "$(dirname $0)" | ||
|
||
docker build -t wagoodman/dive:dev - <<EOF | ||
FROM golang:alpine AS build | ||
RUN apk add -U --no-cache gpgme-dev gcc musl-dev btrfs-progs-dev lvm2-dev curl git \ | ||
&& curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh \ | ||
&& curl -L https://download.docker.com/linux/static/stable/x86_64/docker-19.03.1.tgz | tar -xzf - docker/docker --strip-component=1 -C /usr/local/bin | ||
EOF | ||
|
||
docker run --rm \ | ||
-v //var/run/docker.sock://var/run/docker.sock \ | ||
-v /$(pwd)://src \ | ||
-w //src \ | ||
wagoodman/dive:dev \ | ||
goreleaser \ | ||
-f .goreleaser.docker.yml \ | ||
--snapshot \ | ||
--skip-publish \ | ||
--rm-dist | ||
|
||
sudo chown -R $USER:$USER dist |