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

Bicaws-3025: Add amazon linux 2023 image #252

Merged
merged 17 commits into from
Aug 15, 2023
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: 2.1
jobs:
test:
machine:
image: ubuntu-2004:202104-01
image: ubuntu-2204:2023.07.2
docker_layer_caching: true
steps:
- checkout
Expand Down
19 changes: 19 additions & 0 deletions Amazon_Linux_2023_Base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG BUILD_IMAGE="amazonlinux:2023"

FROM ${BUILD_IMAGE}

LABEL maintainer="CJSE"
ARG DNF_PACKAGES="pip gzip tar unzip openssl shadow-utils xz wget gnupg dirmngr"

RUN dnf update -y &&\
dnf install -y ${DNF_PACKAGES} --allowerasing

# https://github.com/aws/aws-cli/issues/8036
RUN pip install wheel &&\
pip install "Cython<3.0" "pyyaml<6" --no-build-isolation
Copy link
Collaborator

@richardcane richardcane Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably isn't needed - if you look at the issue, it should only affect the previous version of awscli.

aws/aws-cli#8036 (comment)


RUN rm -rf /var/log/* &&\
dnf clean all &&\
rm -rf /var/cache/dnf

CMD ["tail", "-f", "/dev/null"]
5 changes: 5 additions & 0 deletions Amazon_Linux_2023_Base/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SHELL := /bin/bash # Use bash syntax
.PHONY: build

build:
bash build.sh
13 changes: 13 additions & 0 deletions Amazon_Linux_2023_Base/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

IMAGE="amazon-linux2023-base"

docker build -t "${IMAGE}" .

if [ "$SKIP_GOSS" = "true" ]; then
echo "Skipping dgoss tests"
else
GOSS_SLEEP=15 dgoss run $IMAGE
fi
11 changes: 11 additions & 0 deletions Amazon_Linux_2023_Base/buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

version: 0.2
phases:
build:
commands:
- set -ev
- cd ./Amazon_Linux_2023_Base
- /bin/bash ./scripts/build_docker.sh

...
18 changes: 18 additions & 0 deletions Amazon_Linux_2023_Base/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
file:
/etc/passwd:
exists: true
mode: "0644"
size: 839
owner: root
group: root
filetype: file
contains: []
user:
nobody:
exists: true
uid: 65534
gid: 65534
groups:
- nobody
home: /
shell: /sbin/nologin
25 changes: 25 additions & 0 deletions Amazon_Linux_2023_Base/scripts/build_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -e

export readonly REPOSITORY_NAME="amazon-linux2023-base"
export readonly SOURCE_REPOSITORY_NAME="amazon-linux-2023"

/bin/bash ../scripts/build_and_push_image.sh

aws codebuild start-build --project-name "build-openjdk-jre11-slim-docker" \
--environment-variables-override name=DOCKER_IMAGE_HASH,value="${DOCKER_IMAGE_PREFIX}@${SHA_HASH}",type=PLAINTEXT

aws codebuild start-build --project-name "build-nodejs-16-docker" \
--environment-variables-override name=DOCKER_IMAGE_HASH,value="${DOCKER_IMAGE_PREFIX}@${SHA_HASH}",type=PLAINTEXT

aws codebuild start-build --project-name "build-logstash-docker" \
--environment-variables-override name=DOCKER_IMAGE_HASH,value="${DOCKER_IMAGE_PREFIX}@${SHA_HASH}",type=PLAINTEXT

aws codebuild start-build --project-name "build-grafana-ssl-docker"

aws codebuild start-build --project-name "build-grafana-codebuild-ssl-docker"

aws codebuild start-build --project-name "build-nginx-supervisord-docker"

aws codebuild start-build --project-name "build-postfix-docker"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BASE_CONTAINERS:= Amazon_Linux_Base Openjdk_Jre11_Slim NodeJS Postfix Codebuild_Base
BASE_CONTAINERS:= Amazon_Linux_Base Openjdk_Jre11_Slim NodeJS Postfix Codebuild_Base Amazon_Linux_2023_Base
NGINX_CONTAINERS:= Nginx_NodeJS_Supervisord Nginx_Supervisord Nginx_Auth_Proxy Nginx_Java_Supervisord S3_Web_Proxy Scanning_Results_Portal Conductor
MONITORING_CONTAINERS:= Grafana Grafana_Codebuild Prometheus Prometheus_Cloudwatch_Exporter Logstash Prometheus_BlackBox_Exporter

Expand Down