Skip to content

Commit

Permalink
README.md: how to install image-tools
Browse files Browse the repository at this point in the history
Signed-off-by: Sn0rt <wanggh-fnst@cn.fujitsu.com>
  • Loading branch information
Sn0rt committed Dec 2, 2016
1 parent 421458f commit b19267f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ TOOLS := \
oci-create-runtime-bundle \
oci-image-validate \
oci-unpack
MAN := \
oci-create-runtime-bundle.1 \
oci-image-validate.1 \
oci-unpack.1

default: help

help:
@echo "Usage: make <target>"
@echo
@echo " * 'tools' - Build the oci image tools binaries"
@echo " * 'install' - Install binary"
@echo " * 'check-license' - Check license headers in source files"
@echo " * 'lint' - Execute the source code linter"
@echo " * 'test' - Execute the unit tests"
Expand All @@ -29,6 +34,21 @@ tools: $(TOOLS)
$(TOOLS): oci-%:
go build -ldflags "-X main.gitCommit=${COMMIT}" ./cmd/$@

.PHONY: man install uninstall

_man:
go-md2man -in "cmd/oci-unpack/oci-unpack.1.md" -out "oci-unpack.1"
go-md2man -in "cmd/oci-image-validate/oci-image-validate.1.md" -out "oci-image-validate.1"
go-md2man -in "cmd/oci-create-runtime-bundle/oci-create-runtime-bundle.1.md" -out "oci-create-runtime-bundle.1"

install: _man
install -m 755 $(TOOLS) /usr/local/bin/
install -m 644 $(MAN) /usr/local/share/man/man1

uninstall: clean
rm -f /usr/local/share/man/man1/oci-create-runtime-bundle.1 /usr/local/share/man/man1/oci-image-validate.1 /usr/local/share/man/man1/oci-unpack.1
rm -f /usr/local/bin/oci-create-runtime-bundle /usr/local/bin/oci-image-validate /usr/local/bin/oci-unpack

lint:
@echo "checking lint"
@./.tool/lint
Expand Down Expand Up @@ -73,7 +93,7 @@ install.tools: .install.gitvalidation .install.glide .install.glide-vc .install.
gometalinter --install --update

clean:
rm -rf *~ $(OUTPUT_DIRNAME) $(TOOLS)
rm -rf *~ $(OUTPUT_DIRNAME) $(TOOLS) $(MAN)

.PHONY: \
tools \
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

`image-tools` is a collection of tools for working with the [OCI image format specification](https://github.com/opencontainers/image-spec).

# Building

```
$ go get github.com/opencontainers/image-tools/
$ cd $GOPATH/src/github.com/opencontainers/image-tools/
$ make tools
$ sudo make install
```

# Contributing

Development happens on GitHub. Issues are used for bugs and actionable items and longer discussions can happen on the [mailing list](#mailing-list).
Expand Down

0 comments on commit b19267f

Please sign in to comment.