Skip to content

Commit 8474109

Browse files
authored
Merge pull request #120 from concourse/bionic-base-image
Migrating to ubuntu:bionic and golang-builder
2 parents c00d6a8 + 18b2c69 commit 8474109

File tree

3 files changed

+56
-3
lines changed

3 files changed

+56
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,11 @@ environment is consistent across any `docker` enabled platform. When the docker
219219
image builds, the test are run inside the docker container, on failure they
220220
will stop the build.
221221

222-
Run the tests with the following command:
222+
Run the tests with the following commands for both `alpine` and `ubuntu` images:
223223

224224
```sh
225-
docker build -t s3-resource .
225+
docker build -t s3-resource -f dockerfiles/alpine/Dockerfile .
226+
docker build -t s3-resource -f dockerfiles/ubuntu/Dockerfile .
226227
```
227228

228229
#### Integration tests
@@ -234,7 +235,21 @@ integration will run.
234235
Run the tests with the following command:
235236

236237
```sh
237-
docker build . -t s3-resource --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"
238+
docker build . -t s3-resource -f dockerfiles/alpine/Dockerfile \
239+
--build-arg S3_TESTING_ACCESS_KEY_ID="access-key" \
240+
--build-arg S3_TESTING_SECRET_ACCESS_KEY="some-secret" \
241+
--build-arg S3_TESTING_BUCKET="bucket-non-versioned" \
242+
--build-arg S3_VERSIONED_TESTING_BUCKET="bucket-versioned" \
243+
--build-arg S3_TESTING_REGION="us-east-1" \
244+
--build-arg S3_ENDPOINT="https://s3.amazonaws.com"
245+
246+
docker build . -t s3-resource -f dockerfiles/ubuntu/Dockerfile \
247+
--build-arg S3_TESTING_ACCESS_KEY_ID="access-key" \
248+
--build-arg S3_TESTING_SECRET_ACCESS_KEY="some-secret" \
249+
--build-arg S3_TESTING_BUCKET="bucket-non-versioned" \
250+
--build-arg S3_VERSIONED_TESTING_BUCKET="bucket-versioned" \
251+
--build-arg S3_TESTING_REGION="us-east-1" \
252+
--build-arg S3_ENDPOINT="https://s3.amazonaws.com"
238253
```
239254

240255
### Contributing

dockerfiles/ubuntu/Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM concourse/golang-builder as builder
2+
COPY . /go/src/github.com/concourse/s3-resource
3+
ENV CGO_ENABLED 0
4+
RUN go build -o /assets/in github.com/concourse/s3-resource/cmd/in
5+
RUN go build -o /assets/out github.com/concourse/s3-resource/cmd/out
6+
RUN go build -o /assets/check github.com/concourse/s3-resource/cmd/check
7+
WORKDIR /go/src/github.com/concourse/s3-resource
8+
RUN set -e; for pkg in $(go list ./...); do \
9+
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
10+
done
11+
12+
FROM ubuntu:bionic AS resource
13+
RUN apt-get update \
14+
&& apt-get install -y --no-install-recommends \
15+
tzdata \
16+
ca-certificates \
17+
unzip \
18+
zip \
19+
&& rm -rf /var/lib/apt/lists/*
20+
COPY --from=builder assets/ /opt/resource/
21+
RUN chmod +x /opt/resource/*
22+
23+
FROM resource AS tests
24+
ARG S3_TESTING_ACCESS_KEY_ID
25+
ARG S3_TESTING_SECRET_ACCESS_KEY
26+
ARG S3_TESTING_SESSION_TOKEN
27+
ARG S3_VERSIONED_TESTING_BUCKET
28+
ARG S3_TESTING_BUCKET
29+
ARG S3_TESTING_REGION
30+
ARG S3_ENDPOINT
31+
ARG TEST_SESSION_TOKEN
32+
COPY --from=builder /tests /go-tests
33+
WORKDIR /go-tests
34+
RUN set -e; for test in /go-tests/*.test; do \
35+
$test; \
36+
done
37+
38+
FROM resource

0 commit comments

Comments
 (0)