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 3a3deba
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 4 deletions.
28 changes: 25 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ TOOLS := \
oci-create-runtime-bundle \
oci-image-validate \
oci-unpack
MAN := $(TOOLS:%=%.1)

default: help

help:
@echo "Usage: make <target>"
@echo
@echo " * 'tools' - Build the oci image tools binaries"
@echo " * 'all' - Build the oci tools and manual pages"
@echo " * 'install' - Install binary and manual pages"
@echo " * 'check-license' - Check license headers in source files"
@echo " * 'lint' - Execute the source code linter"
@echo " * 'test' - Execute the unit tests"
Expand All @@ -26,9 +29,23 @@ check-license:

tools: $(TOOLS)

man: $(MAN)

all: $(TOOLS) $(MAN)

$(TOOLS): oci-%:
go build -ldflags "-X main.gitCommit=${COMMIT}" ./cmd/$@

$(MAN): %.1: cmd/*/*.1.md
go-md2man -in "$<" -out "$@"

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

uninstall: clean
rm -f $(patsubst %,/usr/local/share/man/man1/%,$(MAN)) $(patsubst %,/usr/local/bin/%,$(TOOLS))

lint:
@echo "checking lint"
@./.tool/lint
Expand Down Expand Up @@ -73,12 +90,17 @@ 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: \
all \
tools \
$(TOOLS) \
man \
install \
uninstall \
check-license \
clean \
lint \
test
test \
$(MAN) \
$(TOOLS)
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,72 @@

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

# Install

Recommend to use `go` to download.

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

## uninstall

```
$ sudo make uninstall
```

## example

Firstly, May be you need to install `skopeo` and more information at [here](https://github.com/projectatomic/skopeo).

And now skopeo is available from Fedora 23:

```
$ sudo dnf install skopeo
```

### oci-create-runtime-bundle

more information about `oci-create-runtime-bundle` can be found [here](./cmd/oci-create-runtime-bundle/oci-create-runtime-bundle.1.md)

```
$ skopeo copy docker://busybox oci:busybox-oci
$ mkdir busybox-bundle
$ oci-create-runtime-bundle --ref latest busybox-oci busybox-bundle
$ cd busybox-bundle && sudo runc run busybox
```

### oci-image-validate

more information about `oci-image-validate` can be found [here](./cmd/oci-image-validate/oci-image-validate.1.md)

```
$ skopeo copy docker://busybox oci:busybox-oci
$ oci-image-validate --type imageLayout --ref latest busybox-oci
busybox-oci: OK
```

### oci-unpack

more information about `oci-unpack` can be found [here](./cmd/oci-unpack/oci-unpack.1.md)

```
$ skopeo copy docker://busybox oci:busybox-oci
$ mkdir busybox-bundle
$ oci-unpack --ref latest busybox-oci busybox-bundle
$ tree busybox-bundle
busybox-bundle
├── bin
│   ├── [
│   ├── [[
│   ├── acpid
│   ├── addgroup
│   ├── add-shell
[...]
```
# 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
2 changes: 1 addition & 1 deletion cmd/oci-unpack/oci-unpack.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ oci-unpack \- Unpack an image or image source layout
$ skopeo copy docker://busybox oci:busybox-oci
$ mkdir busybox-bundle
$ oci-unpack --ref latest busybox-oci busybox-bundle
tree busybox-bundle
$ tree busybox-bundle
busybox-bundle
├── bin
│   ├── [
Expand Down

0 comments on commit 3a3deba

Please sign in to comment.