-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from ivanilves/refit-docker-build
Refit Docker build to match our current demands
- Loading branch information
Showing
4 changed files
with
33 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# This file is a template, and might need editing before it works on your project. | ||
FROM golang:1.8-alpine AS builder | ||
# We'll likely need to add SSL root certificates | ||
RUN apk --no-cache add ca-certificates | ||
# Missing part for compiling the application by it self because it requires a sock | ||
# | ||
# NB! This file is a template and might need editing before it works on your project! | ||
# | ||
FROM golang:1.8 AS builder | ||
WORKDIR /go/src/github.com/ivanilves/lstags | ||
COPY . ./ | ||
RUN ln -nfs /bin/bash /bin/sh && make assemble | ||
FROM scratch | ||
# Since we started from scratch, we'll copy the SSL root certificates from the builder | ||
# Since we started from scratch, we'll copy following files from the builder: | ||
# * SSL root certificates bundle | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY lstags /usr/local/bin/lstags | ||
ENTRYPOINT [ "/usr/local/bin/lstags" ] | ||
# * compiled lstags binary | ||
COPY --from=builder /go/src/github.com/ivanilves/lstags/lstags /lstags | ||
ENTRYPOINT [ "/lstags" ] | ||
CMD ["--help"] |
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 |
---|---|---|
|
@@ -31,11 +31,11 @@ You could use `lstags`, if you ... | |
* ... compare local images with registry ones (e.g. know, if image tagged "latest" was re-pushed). | ||
|
||
... pull Ubuntu 14.04 & 16.04, all the Alpine images and Debian "stretch" to have latest software to play with: | ||
``` | ||
```sh | ||
lstags --pull ubuntu~/^1[46]\\.04$/ alpine debian~/stretch/ | ||
``` | ||
... pull and re-push CoreOS-related images from `quay.io` to your own registry (in case these hipsters will break everything): | ||
``` | ||
```sh | ||
lstags -P /quay -r registry.company.io quay.io/coreos/hyperkube quay.io/coreos/flannel | ||
``` | ||
**NB!** In case you use private registry with authentication, make sure your Docker client knows how to authenticate against it! | ||
|
@@ -59,7 +59,7 @@ You can either: | |
https://github.com/ivanilves/lstags/releases | ||
|
||
## Install: From source | ||
``` | ||
```sh | ||
git clone [email protected]:ivanilves/lstags.git | ||
cd lstags | ||
dep ensure | ||
|
@@ -68,9 +68,9 @@ go build | |
``` | ||
**NB!** I assume you have current versions of Go & [dep](https://github.com/golang/dep) installed and also have set up [GOPATH](https://github.com/golang/go/wiki/GOPATH) correctly. | ||
|
||
## Using it with docker | ||
## Using it with Docker | ||
|
||
```sh | ||
``` | ||
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ivanilves/lstags | ||
Usage: | ||
lstags [OPTIONS] REPO1 REPO2 REPOn... | ||
|
@@ -108,17 +108,17 @@ Arguments: | |
|
||
### Analyze an image | ||
|
||
```sh | ||
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ivanilves/lstags alpine~/^3\\./ | ||
``` | ||
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ivanilves/lstags alpine~/^3\\./ | ||
ANALYZE alpine | ||
FETCHED alpine | ||
- | ||
<STATE> <DIGEST> <(local) ID> <Created At> <TAG> | ||
CHANGED sha256:b40e202395eaec699f2d0c5e01e6d6cb8 76da55c8019d 2017-10-25T23:19:51Z alpine:3.6 | ||
ABSENT sha256:d95da16498d5d6fb4b907cbe013f95032 n/a 2017-10-25T23:20:18Z alpine:3.1 | ||
ABSENT sha256:cb275b62f789b211114f28b391fca3cc2 n/a 2017-10-25T23:20:32Z alpine:3.2 | ||
ABSENT sha256:27af7da847283a947c008592f2b2cd6d2 n/a 2017-10-25T23:20:45Z alpine:3.3 | ||
CHANGED sha256:246bbbaa81b28837b64cb9dfc574de958 1a19a71e5d38 2017-10-25T23:20:59Z alpine:3.4 | ||
CHANGED sha256:aa96c8dc3815c44d4aceaf1ee7903ce58 37c7be7a096b 2017-10-25T23:21:13Z alpine:3.5 | ||
<STATE> <DIGEST> <(local) ID> <Created At> <TAG> | ||
CHANGED sha256:b40e202395eaec699f2d0c5e01e6d6cb8 76da55c8019d 2017-10-25T23:19:51Z alpine:3.6 | ||
ABSENT sha256:d95da16498d5d6fb4b907cbe013f95032 n/a 2017-10-25T23:20:18Z alpine:3.1 | ||
ABSENT sha256:cb275b62f789b211114f28b391fca3cc2 n/a 2017-10-25T23:20:32Z alpine:3.2 | ||
ABSENT sha256:27af7da847283a947c008592f2b2cd6d2 n/a 2017-10-25T23:20:45Z alpine:3.3 | ||
CHANGED sha256:246bbbaa81b28837b64cb9dfc574de958 1a19a71e5d38 2017-10-25T23:20:59Z alpine:3.4 | ||
CHANGED sha256:aa96c8dc3815c44d4aceaf1ee7903ce58 37c7be7a096b 2017-10-25T23:21:13Z alpine:3.5 | ||
- | ||
``` |
This file was deleted.
Oops, something went wrong.