Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Dockerfile to conformance directory #104

Merged
merged 1 commit into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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