Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIEDEV-3991][Bundle Authoring]: Create static container image with terraform binaries #78

Merged
merged 17 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
34 changes: 30 additions & 4 deletions .github/workflows/build-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,47 @@ on:
workflow_dispatch:

jobs:
build-push-nginx-static-server:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3
anjanikshree12 marked this conversation as resolved.
Show resolved Hide resolved

- name: Login to Github Container Registry
uses: docker/login-action@v2
anjanikshree12 marked this conversation as resolved.
Show resolved Hide resolved
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
anjanikshree12 marked this conversation as resolved.
Show resolved Hide resolved

- name: Build and push Terraform static server image
uses: docker/build-push-action@v3
anjanikshree12 marked this conversation as resolved.
Show resolved Hide resolved
with:
context: containers/nginx-static-server
push: true
tags: ghcr.io/terrariumcloud/nginx-static-server:latest

build-push:
runs-on: ubuntu-latest
needs: [build-push-nginx-static-server]

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
anjanikshree12 marked this conversation as resolved.
Show resolved Hide resolved

- name: Login to Github Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
anjanikshree12 marked this conversation as resolved.
Show resolved Hide resolved
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
anjanikshree12 marked this conversation as resolved.
Show resolved Hide resolved

- name: Bump version and push tag
id: tag_version
Expand All @@ -31,7 +57,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
anjanikshree12 marked this conversation as resolved.
Show resolved Hide resolved
with:
context: .
push: true
Expand Down
12 changes: 12 additions & 0 deletions containers/nginx-static-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM nginx:latest

# Set working directory to the Nginx document root
WORKDIR /usr/share/nginx/html

# Download the Terraform binary zip file, clean up and reduce the size of the Docker image by removing unnecessary files after installing packages.
RUN apt-get update && apt-get install -y curl && \
anjanikshree12 marked this conversation as resolved.
Show resolved Hide resolved
curl -O https://releases.hashicorp.com/terraform/1.4.7/terraform_1.4.7_linux_amd64.zip && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Start the NGINX server
CMD ["nginx", "-g", "daemon off;"]
Loading