Skip to content

Commit

Permalink
Add Dockerfile support
Browse files Browse the repository at this point in the history
  • Loading branch information
shizhMSFT committed Dec 26, 2018
1 parent 906089e commit 8e4754e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.11-alpine as builder
ADD . /go/src/github.com/shizhMSFT/oras
WORKDIR /go/src/github.com/shizhMSFT/oras
RUN go install github.com/shizhMSFT/oras/cmd/oras

FROM alpine
LABEL maintainer="[email protected]"
RUN apk --update add ca-certificates
COPY --from=builder /go/bin/oras /bin/oras
RUN mkdir /workplace
WORKDIR /workplace
ENTRYPOINT ["/bin/oras"]
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,24 @@ oras pull localhost:5000/hello:latest
```
oras pull -u username -p password myregistry.io/myimage:latest
```

## Running in Docker
### Build the image
```
docker build -t oras .
```

### Run on Linux
```
docker run --rm -it -v $(pwd):/workplace oras pull localhost:5000/hello:latest
```

### Run on Windows PowerShell
```
docker run --rm -it -v ${pwd}:/workplace oras pull localhost:5000/hello:latest
```

### Run on Windows Commands
```
docker run --rm -it -v %cd%:/workplace oras pull localhost:5000/hello:latest
```

0 comments on commit 8e4754e

Please sign in to comment.