Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build git-crypt for alpine #101

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM alpine:edge
MAINTAINER John Torres <enfermo337@yahoo.com>

ARG VERSION
ARG GIT_COMMIT
ARG GIT_DIRTY
COPY . /workspace/

WORKDIR /workspace

RUN echo "BUILD: $VERSION (${GIT_COMMIT}${GIT_DIRTY})" > /IMAGE_VERSION && \
apk add --no-cache libgcc libstdc++ libcrypto1.0 libssl1.0 openssl-dev gcc g++ make git && \
make && \
make install PREFIX=/usr/local && \
apk del --no-cache openssl-dev gcc g++ make git && \
rm -rf /workspace

ENTRYPOINT ["/usr/local/bin/git-crypt"]
CMD []
16 changes: 16 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,19 @@ and does not currently create key files with restrictive permissions,
making it unsuitable for use on a multi-user system. Windows support
will mature in a future version of git-crypt. Bug reports and patches
are most welcome!

### Building git-crypt as a container

To build and bundle git-crypt as a container, simply run:

make build-image

To build, bundle and deploy to your specific container registry, simply run:

IMAGE_REPO=my-fancy-repo make build-image
IMAGE_REPO=my-fancy-repo make push-image

or

make build-image IMAGE_REPO=my-fancy-repo
make push-image IMAGE_REPO=my-fancy-repo
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ CXXFLAGS ?= -Wall -pedantic -Wno-long-long -O2
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
GIT_COMMIT=$(shell git rev-parse HEAD)
GIT_DIRTY=$(shell test -n "`git status --porcelain`" && echo "+CHANGES" || true)
VERSION=$(shell grep VERSION git-crypt.hpp | awk '{print$$NF}' | tr -d '"')
IMAGE_REPO ?= johnt337

ENABLE_MAN ?= no
DOCBOOK_XSL ?= http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
Expand Down Expand Up @@ -88,7 +92,14 @@ install-man: build-man
install -d $(DESTDIR)$(MANDIR)/man1
install -m 644 man/man1/git-crypt.1 $(DESTDIR)$(MANDIR)/man1/

build-image:
docker build --build-arg GIT_COMMIT=$(GIT_COMMIT) --build-arg GIT_DIRTY=$(GIT_DIRTY) --build-arg VERSION=$(VERSION) -t $(IMAGE_REPO)/git-crypt:$(VERSION) .

push-image:
docker push $(IMAGE_REPO)/git-crypt:$(VERSION)

.PHONY: all \
build build-bin build-man \
clean clean-bin clean-man \
install install-bin install-man
install install-bin install-man \
build-image push-image