| 1 | # oci-image-tool [](https://travis-ci.org/opencontainers/image-tools)[](https://goreportcard.com/report/github.com/opencontainers/image-tools) |
| 2 | |
| 3 | `oci-image-tool` is a collection of tools for working with the [OCI image format specification](https://github.com/opencontainers/image-spec). |
| 4 | To build from source code, image-tools requires Go 1.7.x or above. |
| 5 | |
| 6 | ## Install |
| 7 | |
| 8 | It is recommended that use `go get` to download a single command tools. |
| 9 | |
| 10 | ``` |
| 11 | $ go get -d github.com/opencontainers/image-tools/cmd/oci-image-tool |
| 12 | $ cd $GOPATH/src/github.com/opencontainers/image-tools/ |
| 13 | $ make all |
| 14 | $ sudo make install |
| 15 | ``` |
| 16 | |
| 17 | ## Uninstall |
| 18 | |
| 19 | ``` |
| 20 | $ sudo make uninstall |
| 21 | ``` |
| 22 | |
| 23 | ## Example |
| 24 | |
| 25 | ### Obtaining an image |
| 26 | |
| 27 | The following examples assume you have a [image-layout](https://github.com/opencontainers/image-spec/blob/v1.0.0-rc2/image-layout.md) tar archive at `busybox-oci`. |
| 28 | One way to acquire that image is with [skopeo](https://github.com/projectatomic/skopeo#installing): |
| 29 | |
| 30 | ``` |
| 31 | $ skopeo copy docker://busybox oci:busybox-oci:latest |
| 32 | ``` |
| 33 | |
| 34 | ### oci-image-tool-create |
| 35 | |
| 36 | More information about `oci-image-tool-create` can be found in its [man page](./man/oci-image-tool-create.1.md) |
| 37 | |
| 38 | ``` |
| 39 | $ mkdir busybox-bundle |
| 40 | $ oci-image-tool create --ref latest busybox-oci busybox-bundle |
| 41 | $ cd busybox-bundle && sudo runc run busybox |
| 42 | ``` |
| 43 | |
| 44 | ### oci-image-tool-validate |
| 45 | |
| 46 | More information about `oci-image-tool-validate` can be found in its [man page](./man/oci-image-tool-validate.1.md) |
| 47 | |
| 48 | ``` |
| 49 | $ oci-image-tool validate --type imageLayout --ref latest busybox-oci |
| 50 | busybox-oci: OK |
| 51 | ``` |
| 52 | |
| 53 | ### oci-image-tool-unpack |
| 54 | |
| 55 | More information about `oci-image-tool-unpack` can be found in its [man page](./man/oci-image-tool-unpack.1.md) |
| 56 | |
| 57 | ``` |
| 58 | $ mkdir busybox-bundle |
| 59 | $ oci-image-tool unpack --ref latest busybox-oci busybox-bundle |
| 60 | $ tree busybox-bundle |
| 61 | busybox-bundle |
| 62 | ├── bin |
| 63 | │ ├── [ |
| 64 | │ ├── [[ |
| 65 | │ ├── acpid |
| 66 | │ ├── addgroup |
| 67 | │ ├── add-shell |
| 68 | [...] |
| 69 | ``` |
| 70 | |
| 71 | # Contributing |
| 72 | |
| 73 | Development happens on GitHub. Issues are used for bugs and actionable items and longer discussions can happen on the [mailing list](#mailing-list). |
| 74 | |
| 75 | The code is licensed under the Apache 2.0 license found in the `LICENSE` file of this repository. |
| 76 | |
| 77 | ## Code of Conduct |
| 78 | |
| 79 | Participation in the OpenContainers community is governed by [OpenContainer's Code of Conduct](https://github.com/opencontainers/tob/blob/d2f9d68c1332870e40693fe077d311e0742bc73d/code-of-conduct.md). |
| 80 | |
| 81 | ## Discuss your design |
| 82 | |
| 83 | The project welcomes submissions, but please let everyone know what you are working on. |
| 84 | |
| 85 | Before undertaking a nontrivial change to this repository, send mail to the [mailing list](#mailing-list) to discuss what you plan to do. |
| 86 | This gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits. |
| 87 | It also guarantees that the design is sound before code is written; a GitHub pull-request is not the place for high-level discussions. |
| 88 | |
| 89 | Typos and grammatical errors can go straight to a pull-request. |
| 90 | When in doubt, start on the [mailing-list](#mailing-list). |
| 91 | |
| 92 | ## Weekly Call |
| 93 | |
| 94 | The contributors and maintainers of all OCI projects have a weekly meeting Wednesdays at 2:00 PM (USA Pacific.) |
| 95 | Everyone is welcome to participate via [UberConference web][UberConference] or audio-only: 888-587-9088 or 860-706-8529 (no PIN needed.) |
| 96 | An initial agenda will be posted to the [mailing list](#mailing-list) earlier in the week, and everyone is welcome to propose additional topics or suggest other agenda alterations there. |
| 97 | Minutes are posted to the [mailing list](#mailing-list) and minutes from past calls are archived to the [wiki](https://github.com/opencontainers/runtime-spec/wiki) for those who are unable to join the call. |
| 98 | |
| 99 | ## Mailing List |
| 100 | |
| 101 | You can subscribe and join the mailing list on [Google Groups](https://groups.google.com/a/opencontainers.org/forum/#!forum/dev). |
| 102 | |
| 103 | ## IRC |
| 104 | |
| 105 | OCI discussion happens on #opencontainers on Freenode ([logs][irc-logs]). |
| 106 | |
| 107 | ## Git commit |
| 108 | |
| 109 | ### Sign your work |
| 110 | |
| 111 | The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. |
| 112 | The rules are pretty simple: if you can certify the below (from [developercertificate.org](http://developercertificate.org/)): |
| 113 | |
| 114 | ``` |
| 115 | Developer Certificate of Origin |
| 116 | Version 1.1 |
| 117 | |
| 118 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. |
| 119 | 660 York Street, Suite 102, |
| 120 | San Francisco, CA 94110 USA |
| 121 | |
| 122 | Everyone is permitted to copy and distribute verbatim copies of this |
| 123 | license document, but changing it is not allowed. |
| 124 | |
| 125 | |
| 126 | Developer's Certificate of Origin 1.1 |
| 127 | |
| 128 | By making a contribution to this project, I certify that: |
| 129 | |
| 130 | (a) The contribution was created in whole or in part by me and I |
| 131 | have the right to submit it under the open source license |
| 132 | indicated in the file; or |
| 133 | |
| 134 | (b) The contribution is based upon previous work that, to the best |
| 135 | of my knowledge, is covered under an appropriate open source |
| 136 | license and I have the right under that license to submit that |
| 137 | work with modifications, whether created in whole or in part |
| 138 | by me, under the same open source license (unless I am |
| 139 | permitted to submit under a different license), as indicated |
| 140 | in the file; or |
| 141 | |
| 142 | (c) The contribution was provided directly to me by some other |
| 143 | person who certified (a), (b) or (c) and I have not modified |
| 144 | it. |
| 145 | |
| 146 | (d) I understand and agree that this project and the contribution |
| 147 | are public and that a record of the contribution (including all |
| 148 | personal information I submit with it, including my sign-off) is |
| 149 | maintained indefinitely and may be redistributed consistent with |
| 150 | this project or the open source license(s) involved. |
| 151 | ``` |
| 152 | |
| 153 | then you just add a line to every git commit message: |
| 154 | |
| 155 | Signed-off-by: Joe Smith <[email protected]> |
| 156 | |
| 157 | using your real name (sorry, no pseudonyms or anonymous contributions.) |
| 158 | |
| 159 | You can add the sign off when creating the git commit via `git commit -s`. |
| 160 | |
| 161 | ### Commit Style |
| 162 | |
| 163 | Simple house-keeping for clean git history. |
| 164 | Read more on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/) or the Discussion section of [`git-commit(1)`](http://git-scm.com/docs/git-commit). |
| 165 | |
| 166 | 1. Separate the subject from body with a blank line |
| 167 | 2. Limit the subject line to 50 characters |
| 168 | 3. Capitalize the subject line |
| 169 | 4. Do not end the subject line with a period |
| 170 | 5. Use the imperative mood in the subject line |
| 171 | 6. Wrap the body at 72 characters |
| 172 | 7. Use the body to explain what and why vs. how |
| 173 | * If there was important/useful/essential conversation or information, copy or include a reference |
| 174 | 8. When possible, one keyword to scope the change in the subject (i.e. "README: ...", "runtime: ...") |
| 175 | |
| 176 | |
| 177 | [UberConference]: https://www.uberconference.com/opencontainers |
| 178 | [irc-logs]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/ |