Skip to content

Commit

Permalink
Merge pull request #104 from bloodorangeio/dockerfile-move
Browse files Browse the repository at this point in the history
Move Dockerfile to conformance directory
  • Loading branch information
jzelinskie authored Mar 2, 2020
2 parents 2ce66de + 263eb29 commit 8fd41d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ inputs: {}
outputs: {}
runs:
using: docker
image: Dockerfile
image: conformance/Dockerfile
11 changes: 5 additions & 6 deletions Dockerfile → conformance/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Note: this Dockerfile is used for running conformance tests

# ---
# Stage 1: Install certs and build conformance binary
# ---
FROM docker.io/golang:1.13.6-alpine3.11 AS builder
RUN apk --update add git make ca-certificates && \
mkdir -p /go/src/github.com/opencontainers/distribution-spec
WORKDIR /go/src/github.com/opencontainers/distribution-spec
ARG VERSION=unknown
ARG GO_PKG=github.com/opencontainers/distribution-spec/conformance
RUN apk --update add git make ca-certificates && mkdir -p /go/src/${GO_PKG}
WORKDIR /go/src/${GO_PKG}
ADD . .
RUN make conformance-binary && mv output/conformance.test /conformance.test
RUN CGO_ENABLED=0 go test -c -o /conformance.test --ldflags="-X ${GO_PKG}.Version=${VERSION}"

# ---
# Stage 2: Final image with nothing but certs & binary
Expand Down
9 changes: 5 additions & 4 deletions conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ Note: for some registries, you may need to create `OCI_NAMESPACE` ahead of time.

#### Container Image

You may use [Dockerfile](./../Dockerfile) located at the
root of this repo to build a container image that contains the test binary.
You may use the [Dockerfile](./Dockerfile) located in this directory
to build a container image that contains the test binary.

Example (using `docker`):
```
# build the image
(cd ../ && docker build -t conformance:latest -f Dockerfile .)
# build the image, using git SHA as the version
docker build -t conformance:latest \
--build-arg VERSION=$(git log --format="%H" -n 1) .
# run the image
docker run --rm \
Expand Down

0 comments on commit 8fd41d1

Please sign in to comment.