From 0f43eaa993dbaa4bf27ebda743fdccd0d1d25ce7 Mon Sep 17 00:00:00 2001 From: Rui Yang Date: Fri, 2 Jun 2023 16:07:25 -0400 Subject: [PATCH] remove alpine dockerfile;base image is paketo jammy run base Signed-off-by: Rui Yang --- dockerfiles/ubuntu/Dockerfile => Dockerfile | 0 README.md | 6 ++--- dockerfiles/alpine/Dockerfile | 28 --------------------- 3 files changed, 3 insertions(+), 31 deletions(-) rename dockerfiles/ubuntu/Dockerfile => Dockerfile (100%) delete mode 100644 dockerfiles/alpine/Dockerfile 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 2d53b18..18afb39 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,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 tracker-resource -f dockerfiles/alpine/Dockerfile . -docker build -t tracker-resource -f dockerfiles/ubuntu/Dockerfile . +docker build -t tracker-resource --build-arg base_image=paketobuildpacks/run-jammy-base:latest . + ``` ### Contributing diff --git a/dockerfiles/alpine/Dockerfile b/dockerfiles/alpine/Dockerfile deleted file mode 100644 index 378f841..0000000 --- a/dockerfiles/alpine/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -ARG base_image=alpine:latest -ARG builder_image=concourse/golang-builder - -FROM ${builder_image} as builder -WORKDIR /src -COPY . . -RUN go mod download -RUN go build -o /assets/out github.com/concourse/tracker-resource/out/cmd/out -RUN go build -o /assets/in github.com/concourse/tracker-resource/in/cmd/in -RUN go build -o /assets/check github.com/concourse/tracker-resource/check/cmd/check -RUN set -e; mkdir /tests; for pkg in $(go list ./...); do \ - cp -a $(go list -f '{{.Dir}}' $pkg) /tests/$(basename $pkg); \ - go test -o "/tests/$(basename $pkg)/run" -c $pkg; \ - done - -FROM ${base_image} AS resource -RUN apk update && apk upgrade -RUN apk add --update bash tzdata ca-certificates git -COPY --from=builder /assets /opt/resource - -FROM resource AS tests -COPY --from=builder /tests /tests -RUN set -e; for test in /tests/*/run; do \ - cd $(dirname $test); \ - ./run; \ - done - -FROM resource