diff --git a/dockerfiles/ubuntu/Dockerfile b/Dockerfile similarity index 100% rename from dockerfiles/ubuntu/Dockerfile rename to Dockerfile diff --git a/README.md b/README.md index 4c8f3967..ad6fc932 100644 --- a/README.md +++ b/README.md @@ -226,11 +226,11 @@ environment is consistent across any `docker` enabled platform. When the docker image builds, the test are run inside the docker container, on failure they will stop the build. -Run the tests with the following commands for both `alpine` and `ubuntu` images: +Run the tests with the following command: ```sh -docker build -t s3-resource --target tests -f dockerfiles/alpine/Dockerfile . -docker build -t s3-resource --target tests -f dockerfiles/ubuntu/Dockerfile . +docker build -t s3-resource --target tests --build-arg base_image=paketobuildpacks/run-jammy-base:latest . + . ``` #### Integration tests @@ -242,15 +242,7 @@ integration will run. Run the tests with the following command: ```sh -docker build . -t s3-resource --target tests -f dockerfiles/alpine/Dockerfile \ - --build-arg S3_TESTING_ACCESS_KEY_ID="access-key" \ - --build-arg S3_TESTING_SECRET_ACCESS_KEY="some-secret" \ - --build-arg S3_TESTING_BUCKET="bucket-non-versioned" \ - --build-arg S3_VERSIONED_TESTING_BUCKET="bucket-versioned" \ - --build-arg S3_TESTING_REGION="us-east-1" \ - --build-arg S3_ENDPOINT="https://s3.amazonaws.com" - -docker build . -t s3-resource --target tests -f dockerfiles/ubuntu/Dockerfile \ +docker build . -t s3-resource --target tests \ --build-arg S3_TESTING_ACCESS_KEY_ID="access-key" \ --build-arg S3_TESTING_SECRET_ACCESS_KEY="some-secret" \ --build-arg S3_TESTING_BUCKET="bucket-non-versioned" \ diff --git a/dockerfiles/alpine/Dockerfile b/dockerfiles/alpine/Dockerfile deleted file mode 100644 index 0e477b3c..00000000 --- a/dockerfiles/alpine/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -ARG base_image=alpine:latest -ARG builder_image=concourse/golang-builder - -FROM ${builder_image} as builder -COPY . /go/src/github.com/concourse/s3-resource -WORKDIR /go/src/github.com/concourse/s3-resource -ENV CGO_ENABLED 0 -RUN go mod download -RUN go build -o /assets/in ./cmd/in -RUN go build -o /assets/out ./cmd/out -RUN go build -o /assets/check ./cmd/check -RUN set -e; for pkg in $(go list ./...); do \ - go test -o "/tests/$(basename $pkg).test" -c $pkg; \ - done - -FROM ${base_image} AS resource -RUN apk update && apk upgrade -RUN apk add --no-cache bash tzdata ca-certificates unzip zip gzip tar -COPY --from=builder assets/ /opt/resource/ -RUN chmod +x /opt/resource/* - -FROM resource AS tests -ARG S3_TESTING_ACCESS_KEY_ID -ARG S3_TESTING_SECRET_ACCESS_KEY -ARG S3_TESTING_SESSION_TOKEN -ARG S3_TESTING_AWS_ROLE_ARN -ARG S3_VERSIONED_TESTING_BUCKET -ARG S3_TESTING_BUCKET -ARG S3_TESTING_REGION -ARG S3_TESTING_NO_LARGE_UPLOAD -ARG S3_ENDPOINT -ARG TEST_SESSION_TOKEN -COPY --from=builder /tests /go-tests -WORKDIR /go-tests -RUN set -e; for test in /go-tests/*.test; do \ - $test; \ - done - -FROM resource