Skip to content

Commit ca5312e

Browse files
committed
Remove ARM64 support - build amd64 only with Rosetta 2 support for Mac
- Remove linux/arm64 from build platforms - Update README from multi-architecture to amd64-only - Add comprehensive Mac/Rosetta 2 setup instructions - Update CI/CD documentation - Reason: Simplify builds and align with dispatcher-sdk constraints
1 parent ffb1511 commit ca5312e

3 files changed

Lines changed: 204 additions & 37 deletions

File tree

.github/workflows/build.yml

Lines changed: 88 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: build
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags:
8+
- '*'
49

510
jobs:
611
build:
@@ -90,40 +95,94 @@ jobs:
9095
ls -latr $PACKAGE_PATH
9196
source <(curl -sL https://github.com/aem-design/aemdesign-docker/releases/latest/download/github_get_version.sh)
9297
93-
- name: build and test docker image
98+
- name: Set up QEMU
99+
uses: docker/setup-qemu-action@v1
100+
- name: Set up Docker Buildx
101+
uses: docker/setup-buildx-action@v1
102+
103+
- name: Login to DockerHub
104+
uses: docker/login-action@v1
105+
with:
106+
username: ${{ env.DOCKER_USERNAME }}
107+
password: ${{ env.DOCKER_PASSWORD }}
108+
- name: Login to GitHub Container Registry
109+
uses: docker/login-action@v1
110+
with:
111+
registry: ghcr.io
112+
username: ${{ github.repository_owner }}
113+
password: ${{ secrets.GITHUB_TOKEN }}
114+
115+
- name: Build and export to Docker
116+
id: docker_build
117+
uses: docker/build-push-action@v2
118+
with:
119+
context: .
120+
platforms: linux/amd64
121+
load: true
122+
build-args: |
123+
DOCKER_IMAGE_VERSION=${{ env.DOCKER_IMAGE_VERSION }}
124+
tags: |
125+
${{ env.IMAGE }}:${{ env.GIT_BRANCH }}
126+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.GIT_BRANCH }}
127+
128+
- name: test docker image
94129
run: |
95-
docker build --build-arg DOCKER_IMAGE_VERSION="${DOCKER_IMAGE_VERSION}" --pull --squash -t $IMAGE:$GIT_BRANCH .
96-
(cd test && bash ./run_tests.sh "$IMAGE:$GIT_BRANCH" "$PACKAGE_CKECK_COUNT")
97-
docker images
130+
cd test && bash ./run_tests.sh "ghcr.io/$GITHUB_REPOSITORY_OWNER/$IMAGE:$GIT_BRANCH" "$PACKAGE_CKECK_COUNT"
98131
env:
99132
PACKAGE_CKECK_COUNT: ${{ steps.config.outputs.PACKAGE_CKECK_COUNT }}
100133

101-
- name: login to docker registry
102-
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${DOCKER_REGISTRY} -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
134+
- name: Run docker image analysis
135+
continue-on-error: true
136+
uses: MaxymVlasov/dive-action@v1.4.0
137+
with:
138+
image: ${{ steps.docker_build.outputs.imageid }}
139+
config-file: ${{ github.workspace }}/.dive-ci.yml
140+
github-token: ${{ secrets.GITHUB_TOKEN }}
103141

104-
- name: push image version
105-
run: |
106-
docker push $IMAGE:$GIT_BRANCH
107-
- name: push latest image on master
108-
if: github.ref == 'refs/heads/master'
142+
- name: Generate tags
143+
id: tags
109144
run: |
110-
docker tag $IMAGE:$GIT_BRANCH $IMAGE:latest
111-
docker push $IMAGE:latest
145+
# Check if this is a tag push
146+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
147+
# Extract tag name (e.g., refs/tags/2.0.187 -> 2.0.187)
148+
VERSION_TAG="${{ github.ref_name }}"
149+
TAGS="${IMAGE}:${VERSION_TAG}"
150+
TAGS="${TAGS},ghcr.io/${GITHUB_REPOSITORY_OWNER}/${IMAGE}:${VERSION_TAG}"
151+
echo "Building from git tag: ${VERSION_TAG}"
152+
else
153+
# Branch push - use branch name
154+
TAGS="${IMAGE}:${GIT_BRANCH}"
155+
TAGS="${TAGS},ghcr.io/${GITHUB_REPOSITORY_OWNER}/${IMAGE}:${GIT_BRANCH}"
156+
if [ "${{ github.ref }}" = "refs/heads/master" ]; then
157+
TAGS="${TAGS},${IMAGE}:latest"
158+
TAGS="${TAGS},ghcr.io/${GITHUB_REPOSITORY_OWNER}/${IMAGE}:latest"
159+
fi
160+
echo "Building from branch: ${GIT_BRANCH}"
161+
fi
162+
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
163+
echo "Generated tags: ${TAGS}"
112164
113-
- name: update registry description with readme on master
114-
if: github.ref == 'refs/heads/master'
115-
run: |
116-
docker run --rm -v $(pwd):/data/ aemdesign/dockerhub-description "$DOCKER_USERNAME" "$DOCKER_PASSWORD" "$IMAGE"
165+
- name: Build and push
166+
uses: docker/build-push-action@v2
167+
with:
168+
context: .
169+
platforms: linux/amd64
170+
push: true
171+
build-args: |
172+
DOCKER_IMAGE_VERSION=${{ env.DOCKER_IMAGE_VERSION }}
173+
tags: ${{ steps.tags.outputs.tags }}
117174

118-
- name: create release ${{ env.GITHUB_TAG }}
119-
if: github.ref == 'refs/heads/master'
120-
id: create_release
121-
uses: actions/create-release@v1
122-
env:
123-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175+
- name: Update Docker Hub Description
176+
uses: peter-evans/dockerhub-description@v2
177+
continue-on-error: true
178+
with:
179+
username: ${{ env.DOCKER_USERNAME }}
180+
password: ${{ env.DOCKER_PASSWORD }}
181+
repository: aemdesign/aem
182+
- uses: meeDamian/github-release@1.0
183+
if: startsWith(github.ref, 'refs/tags/')
124184
with:
125-
tag_name: ${{ env.GITHUB_TAG }}
126-
release_name: ${{ env.GITHUB_TAG }}
127-
body: ${{ steps.config.outputs.GIT_RELEASE_NOTES }}
128-
draft: false
129-
prerelease: false
185+
token: ${{ secrets.GITHUB_TOKEN }}
186+
tag: ${{ github.ref_name }}
187+
name: ${{ github.ref_name }}
188+
body: ${{ env.GIT_RELEASE_NOTES }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ maven-eclipse.xml
1313

1414
target/
1515
logs/
16+
jar/

README.md

Lines changed: 115 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## Debian with AEM SDK
1+
## AEM SDK
22

3-
[![build_status](https://github.com/aem-design/docker-aem/workflows/build/badge.svg?branch=sdk-2023.1.10912)](https://github.com/aem-design/docker-aem/actions?query=workflow%3Abuild+branch%3Asdk-2023.1.10912)
3+
[![build_status](https://github.com/aem-design/docker-aem/workflows/build/badge.svg?branch=sdk-2025.7.21644)](https://github.com/aem-design/docker-aem/actions?query=workflow%3Abuild+branch%3Asdk-2025.7.21644)
44
[![github license](https://img.shields.io/github/license/aem-design/aem)](https://github.com/aem-design/aem)
55
[![github issues](https://img.shields.io/github/issues/aem-design/aem)](https://github.com/aem-design/aem)
66
[![github last commit](https://img.shields.io/github/last-commit/aem-design/aem)](https://github.com/aem-design/aem)
@@ -9,9 +9,23 @@
99
[![docker pulls](https://img.shields.io/docker/pulls/aemdesign/aem)](https://hub.docker.com/r/aemdesign/aem)
1010
[![github release](https://img.shields.io/github/release/aem-design/aem)](https://github.com/aem-design/aem)
1111

12-
This is docker image based on CentOS 8 with Tini
13-
One image that can be used for both Author and Publish nodes
14-
No license is included, you will need to register when starting up
12+
Docker image based on [aemdesign/aem-base](https://hub.docker.com/r/aemdesign/aem-base/) with AEM SDK.
13+
14+
One image that can be used for both Author and Publish nodes. No license is included, you will need to register when starting up.
15+
16+
Docker image for linux/amd64 (also runs on Apple Silicon via Rosetta 2).
17+
18+
## Docker Images
19+
20+
Images are available on both registries:
21+
- **Docker Hub**: `aemdesign/aem`
22+
- **GitHub Container Registry**: `ghcr.io/aem-design/aem`
23+
24+
### Tags
25+
26+
- `latest` - Latest build from master branch
27+
- `sdk-2025.7.21644` - Current SDK version branch
28+
- Version tags (pushed when git tags are created)
1529

1630
### AEM Version
1731

@@ -67,11 +81,104 @@ Following bundles are added to container
6781

6882
### Starting
6983

70-
To start author run the following
84+
To start author run the following:
85+
86+
```bash
87+
docker run --name author-sdk-2025-7-21644 -e "TZ=Australia/Sydney" -e "AEM_RUNMODE=-Dsling.run.modes=author,crx3,crx3tar,localdev" -e "AEM_JVM_OPTS=-server -Xms248m -Xmx1524m -XX:MaxDirectMemorySize=256M -XX:+CMSClassUnloadingEnabled -Djava.awt.headless=true -Dorg.apache.felix.http.host=0.0.0.0 -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=58242,suspend=n -XX:+UseParallelGC --add-opens=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED --add-opens=java.naming/javax.naming.spi=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED -Dnashorn.args=--no-deprecation-warning" -p4502:8080 -p30303:58242 -d aemdesign/aem:sdk-2025.7.21644
88+
```
89+
90+
## Development
91+
92+
### CI/CD Pipeline
93+
94+
The project uses GitHub Actions for continuous integration and deployment:
95+
96+
- **Platform**: Images are built for `linux/amd64`
97+
- **Apple Silicon support**: Works seamlessly on M1/M2/M3/M4 Macs via Docker Desktop's Rosetta 2 emulation
98+
- **Automated testing**: Java version is verified before pushing
99+
- **Image analysis**: Uses `dive` for Docker image layer analysis
100+
- **Dual registry push**: Automatically pushes to Docker Hub and GitHub Container Registry
101+
- **Git tag versioning**: Pushing a git tag automatically creates a corresponding Docker image tag
102+
103+
### Running on Apple Silicon Macs (M1/M2/M3/M4)
104+
105+
This image is built for `linux/amd64` architecture but runs seamlessly on Apple Silicon Macs through **Rosetta 2** emulation in Docker Desktop.
106+
107+
#### Prerequisites
108+
109+
1. **Docker Desktop for Mac** (version 4.25.0 or later recommended)
110+
- Download from: https://www.docker.com/products/docker-desktop
111+
112+
2. **Rosetta 2** (usually already installed on modern macOS)
113+
- To verify/install: `softwareupdate --install-rosetta`
114+
115+
#### Enable Rosetta 2 in Docker Desktop
116+
117+
1. Open **Docker Desktop**
118+
2. Go to **Settings** (⚙️ icon) → **General**
119+
3. Enable **"Use Rosetta for x86_64/amd64 emulation on Apple Silicon"**
120+
4. Click **Apply & Restart**
121+
122+
![Docker Desktop Rosetta Setting](https://docs.docker.com/desktop/images/rosetta.png)
123+
124+
#### Verify It's Working
125+
126+
```bash
127+
# Pull and run the image
128+
docker pull aemdesign/aem:latest
129+
docker run --rm aemdesign/aem:latest uname -m
130+
131+
# Expected output: x86_64 (running via Rosetta 2)
132+
```
133+
134+
#### Performance Notes
135+
136+
- **Rosetta 2 emulation** provides near-native performance for most workloads
137+
- First container start may be slightly slower (Rosetta translation cache warmup)
138+
- Subsequent starts are fast
139+
- **No code changes needed** - everything works transparently
140+
141+
### Monitoring Pipeline Status
142+
143+
Use the `get-action-logs.ps1` PowerShell script to monitor GitHub Actions workflow status and logs.
144+
145+
#### Prerequisites
146+
147+
- GitHub CLI (`gh`) must be installed and authenticated
148+
- Install: `winget install --id GitHub.cli`
149+
- Authenticate: `gh auth login`
150+
151+
#### Quick Start
152+
153+
```powershell
154+
# Check current commit's pipeline status (saves logs to logs/ folder by default)
155+
.\get-action-logs.ps1
156+
157+
# Wait for pipeline to complete
158+
.\get-action-logs.ps1 -WaitForCompletion
159+
160+
# Show logs in console
161+
.\get-action-logs.ps1 -ShowLogs
162+
163+
# Force re-download logs
164+
.\get-action-logs.ps1 -Force
165+
```
166+
167+
See full documentation: `Get-Help .\get-action-logs.ps1 -Full`
168+
169+
### Creating a New Release
71170

72171
```bash
73-
docker run --name author-sdk-2023-1-10912 -e "TZ=Australia/Sydney" -e "AEM_RUNMODE=-Dsling.run.modes=author,crx3,crx3tar,localdev" -e "AEM_JVM_OPTS=-server -Xms248m -Xmx1524m -XX:MaxDirectMemorySize=256M -XX:+CMSClassUnloadingEnabled -Djava.awt.headless=true -Dorg.apache.felix.http.host=0.0.0.0 -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=58242,suspend=n -XX:+UseParallelGC --add-opens=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED --add-opens=java.naming/javax.naming.spi=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED -Dnashorn.args=--no-deprecation-warning" -p4502:8080 -p30303:58242 -d aemdesign/aem:sdk-2022.4.7138
74-
```
172+
# Tag the commit
173+
git tag sdk-2025.7.21644-v1
174+
git push origin sdk-2025.7.21644-v1
175+
```
176+
177+
This will automatically build and push versioned Docker images to both registries.
178+
179+
## License
180+
181+
See [LICENSE](LICENSE) file for details.
75182

76183

77184

0 commit comments

Comments
 (0)