Skip to content

Commit

Permalink
Merge pull request #40 from duplocloud/DUPLO-16826-amazon-ecr-credent…
Browse files Browse the repository at this point in the history
…ial-helper

DUPLO-16826 Add amazon-ecr-credential-helper
  • Loading branch information
duplodavid authored May 13, 2024
2 parents 4931240 + 1de41a9 commit 7e0604c
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# AWS credentials
- name: Packer AWS Role
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:

# Upload the image manifest
- name: Attach Manifest
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: packer-manifest.json
path: packer-manifest.json
Expand All @@ -117,7 +117,7 @@ jobs:
duplo_token: "${{ secrets.GOVCLOUD_DUPLO_TOKEN }}"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# AWS credentials
- name: Tenant AWS JIT
Expand All @@ -127,7 +127,7 @@ jobs:

# AWS credentials
- name: Packer AWS Role
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
Expand Down
8 changes: 6 additions & 2 deletions AgentAmazonLinux2/Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ubuntuInstall () {
}


installDependancies () {
installDependencies () {

if [ "$OS" = "centos" ]; then
echo "Centos Installing docker"
Expand Down Expand Up @@ -115,6 +115,8 @@ installDependancies () {
sudo amazon-linux-extras install -q -y docker
sudo yum install -q -y docker
sudo usermod -a -G docker ec2-user
sudo yum install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json

sudo yum install -q -y git wget curl net-tools vim
sudo yum install -q -y yum-utils
Expand All @@ -139,6 +141,8 @@ installDependancies () {
echo "Ubuntu Installing Container Management Service"
sudo apt-get update
sudo apt install -q -y python3-dev python3-pip bridge-utils python3-virtualenv gcc
sudo apt install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json
###
options=`cat /etc/default/docker | grep bridge`
echo $options
Expand Down Expand Up @@ -197,7 +201,7 @@ echo "Step 1: Install Docker and setup docker bridge";
echo "--------------------------OS=$OS VER=$VER-------------------------------------1"
echo; echo;

installDependancies
installDependencies



Expand Down
6 changes: 4 additions & 2 deletions AgentUbuntu20/Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ubuntuInstall () {
}


installDependancies () {
installDependencies () {

if [ "$OS" = "centos" ]; then
echo "Centos Installing docker"
Expand Down Expand Up @@ -113,6 +113,8 @@ installDependancies () {
echo "Ubuntu Installing Container Management Service"
sudo apt-get update
sudo apt install -q -y python3-dev python3-pip bridge-utils python3-virtualenv gcc
sudo apt install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json
###
options=`cat /etc/default/docker | grep bridge`
echo $options
Expand Down Expand Up @@ -166,7 +168,7 @@ echo "Step 1: Install Docker and setup docker bridge";
echo "--------------------------OS=$OS VER=$VER-------------------------------------1"
echo; echo;

installDependancies
installDependencies



Expand Down
8 changes: 6 additions & 2 deletions AgentUbuntu22/Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ubuntuInstall () {
}


installDependancies () {
installDependencies () {

if [ "$OS" = "centos" ]; then
echo "Centos Installing docker"
Expand Down Expand Up @@ -116,6 +116,8 @@ installDependancies () {
sudo amazon-linux-extras install -q -y docker
sudo yum install -q -y docker
sudo usermod -a -G docker ec2-user
sudo yum install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json

sudo yum install -q -y git wget curl net-tools vim
sudo yum install -q -y yum-utils
Expand All @@ -140,6 +142,8 @@ installDependancies () {
echo "Ubuntu Installing Container Management Service"
sudo apt-get update
sudo apt install -q -y python3-dev python3-pip bridge-utils python3-virtualenv gcc
sudo apt install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json

###
options=`cat /etc/default/docker | grep bridge`
Expand Down Expand Up @@ -205,7 +209,7 @@ echo "Step 1: Install Docker and setup docker bridge";
echo "--------------------------OS=$OS VER=$VER-------------------------------------1"
echo; echo;

installDependancies
installDependencies



Expand Down
8 changes: 6 additions & 2 deletions AgentUbuntu22/SetupPython3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ubuntuInstall () {
}


installDependancies () {
installDependencies () {

if [ "$OS" = "centos" ]; then
echo "Centos Installing docker"
Expand Down Expand Up @@ -119,6 +119,8 @@ installDependancies () {
sudo amazon-linux-extras install -q -y docker
sudo yum install -q -y docker
sudo usermod -a -G docker ec2-user
sudo yum install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json

sudo yum install -q -y git wget curl net-tools vim
sudo yum install -q -y yum-utils
Expand All @@ -143,6 +145,8 @@ installDependancies () {
echo "Ubuntu Installing Container Management Service"
sudo apt-get update
sudo apt install -q -y python3-dev python3-pip bridge-utils python3-virtualenv gcc
sudo apt install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json

###
options=`cat /etc/default/docker | grep bridge`
Expand Down Expand Up @@ -208,7 +212,7 @@ echo "Step 1: Install Docker and setup docker bridge";
echo "--------------------------OS=$OS VER=$VER-------------------------------------1"
echo; echo;

installDependancies
installDependencies



Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 2024-04-18

### Added
- Installed `amazon-ecr-credential-helper` and configured Docker to use it across Ubuntu 20, Ubuntu 22, and AmazonLinux2 setups.

### Changed
- Corrected function name typo from `installDependancies` to `installDependencies` in setup scripts.
- Updated GitHub Actions in the workflow file to use newer versions (v4) for better performance and features.

## 2024-02-16

### Added
Expand Down

0 comments on commit 7e0604c

Please sign in to comment.