Skip to content
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
18 changes: 0 additions & 18 deletions .github/workflows/build.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docker Image CI

on: [push]

env:
ECR_REPOSITORY: toolbox
jobs:
upload-docker-image:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.TRUSS_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TRUSS_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: Login to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Create ECR repository if not exists
uses: int128/create-ecr-repository-action@v1
id: ecr
with:
repository: ${{ env.ECR_REPOSITORY }}

- name: Build Docker image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ env.ECR_REPOSITORY }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .


- name: Push Docker image to AWS ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ env.ECR_REPOSITORY }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
15 changes: 6 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,20 @@ RUN apk add --update \
&& rm -rf /var/cache/apk/*

# HashiCorp Vault
COPY --from=vault:latest /bin/vault /usr/bin/vault
COPY --from=hashicorp/vault:latest /bin/vault /usr/bin/vault

ENV VAULT_ADDR https://vault.vault.svc:8200
ENV VAULT_SKIP_VERIFY true

# HashiCorp Consul
COPY --from=consul:latest /bin/consul /usr/bin/consul
ENV CONSUL_HTTP_ADDR http://consul.vault.svc:8500

# kubectl
COPY --from=bitnami/kubectl:1.15-ol-7 /opt/bitnami/kubectl/bin/kubectl /usr/bin/kubectl
COPY --from=bitnami/kubectl:1.33.2 /opt/bitnami/kubectl/bin/kubectl /usr/bin/kubectl

# AWS CLI
RUN /usr/bin/easy_install-3.8 pip && pip install awscli
RUN apk add --no-cache aws-cli

# Scuttle
COPY --from=redboxoss/scuttle:latest /scuttle /usr/bin/scuttle
# add only redis cli from redis suite
COPY --from=redis:7-alpine /usr/local/bin/redis-cli /usr/local/bin/redis-cli
RUN chmod +x /usr/local/bin/redis-cli

COPY motd /etc/motd
COPY entrypoint.sh ./
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build:
docker build -t jdharrington/toolbox:latest .
docker build -t 127178877223.dkr.ecr.us-east-2.amazonaws.com/toolbox:latest .

push:
docker push jdharrington/toolbox:latest
docker push 127178877223.dkr.ecr.us-east-2.amazonaws.com/toolbox:latest
12 changes: 2 additions & 10 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@

set -e

export ENVOY_ADMIN_API="http://127.0.0.1:15000"
export ISTIO_QUIT_API="http://127.0.0.1:15020"
export START_WITHOUT_ENVOY="true"

if [ "${ISTIO_ENABLED}" = "true" ]; then
export SCUTTLE_CMD=/usr/bin/scuttle
fi

if [ "${1}" = "" ]; then
exec ${SCUTTLE_CMD} /bin/bash -l
exec /bin/bash -l
else
exec ${SCUTTLE_CMD} "$@"
exec "$@"
fi