-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM alpine:3 | ||
|
||
ENV TERRAFORM_VERSION 0.12.25-r0 | ||
|
||
RUN apk update \ | ||
&& apk add --no-cache \ | ||
bash \ | ||
curl \ | ||
jq \ | ||
terraform=${TERRAFORM_VERSION} \ | ||
# ping group has a conflicting id: 999 so delete it | ||
&& delgroup ping \ | ||
&& addgroup -g 999 setup \ | ||
&& adduser -u 999 -D -G setup setup \ | ||
&& mkdir /terraform /scripts \ | ||
&& chown -R setup:setup /terraform /scripts | ||
|
||
# main.tf is copied from ../../helm/sumologic/conf/setup/setup.sh to minimize | ||
# docker context just to current directory | ||
COPY --chown=setup:setup ./main.tf /terraform/ | ||
|
||
USER setup | ||
RUN cd /terraform/ \ | ||
&& terraform init \ | ||
&& rm main.tf | ||
|
||
ARG BUILD_TAG=latest | ||
ENV TAG $BUILD_TAG | ||
|
||
WORKDIR /terraform/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
BUILD_TAG ?= latest | ||
IMAGE_NAME = setupjob | ||
ECR_URL = public.ecr.aws/u5z5f8z6 | ||
REPO_URL = $(ECR_URL)/$(IMAGE_NAME) | ||
|
||
build: | ||
DOCKER_BUILDKIT=1 docker build \ | ||
--build-arg BUILD_TAG=$(BUILD_TAG) \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
--cache-from $(REPO_URL):latest \ | ||
--tag $(IMAGE_NAME):$(BUILD_TAG) \ | ||
. | ||
|
||
push: | ||
docker tag $(IMAGE_NAME):$(BUILD_TAG) $(REPO_URL):$(BUILD_TAG) | ||
docker push $(REPO_URL):$(BUILD_TAG) | ||
|
||
login: | ||
aws ecr-public get-login-password --region us-east-1 \ | ||
| docker login --username AWS --password-stdin $(ECR_URL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
terraform { | ||
required_providers { | ||
sumologic = "~> 2.4" | ||
kubernetes = "~> 1.13.0" | ||
} | ||
} |