Skip to content

Commit b81e622

Browse files
committed
Does this make a single Docker manifest?
1 parent af44701 commit b81e622

File tree

5 files changed

+42
-29
lines changed

5 files changed

+42
-29
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ RUN yum groupinstall -y 'Development Tools' && \
88
# Local devcontainer compatibility.
99
ENTRYPOINT []
1010
RUN mkdir -p /workspaces/live-development
11+
WORKDIR /workspaces/live-development

.github/workflows/package.yml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,40 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v3
14-
- name: Environment
15-
run: |
16-
echo "GHCR_USER=${{ github.actor }}" >> $GITHUB_ENV
17-
echo "GHCR_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
1814
- name: Set up QEMU
1915
uses: docker/setup-qemu-action@v2
2016
- name: Set up Docker Buildx
2117
uses: docker/setup-buildx-action@v2
18+
id: builder
2219
- name: Registry Login
2320
uses: docker/login-action@v2
2421
with:
2522
registry: ghcr.io
2623
username: ${{ github.actor }}
2724
password: ${{ secrets.GITHUB_TOKEN }}
28-
- name: Build (amd64)
29-
uses: devcontainers/ci@v0.3
25+
- name: Build Builder (amd64)
26+
uses: docker/build-push-action@v4
3027
with:
31-
push: never
32-
imageName: live-development-amd64
33-
platform: linux/amd64
34-
runCmd: ./bin/build
35-
- name: Package (amd64)
36-
run: ./bin/package-platform amd64
37-
- name: Build (arm64)
38-
uses: devcontainers/ci@v0.3
28+
builder: ${{ steps.builder.outputs.name }}
29+
outputs: type=docker
30+
context: ./.devcontainer
31+
platforms: linux/amd64
32+
tags: ghcr.io/rails-lambda/live-development-builder:amd64
33+
- name: Build Builder (arm64)
34+
uses: docker/build-push-action@v4
3935
with:
40-
push: never
41-
imageName: live-development-arm64
42-
platform: linux/arm64
43-
runCmd: ./bin/build
44-
- name: Package (arm64)
45-
run: ./bin/package-platform arm64
46-
- name: Package (manifest)
47-
run: ./bin/package
36+
builder: ${{ steps.builder.outputs.name }}
37+
outputs: type=docker
38+
context: ./.devcontainer
39+
platforms: linux/arm64/v8
40+
tags: ghcr.io/rails-lambda/live-development-builder:arm64
41+
- name: Package
42+
uses: docker/build-push-action@v4
43+
with:
44+
builder: ${{ steps.builder.outputs.name }}
45+
context: .
46+
platforms: linux/amd64,linux/arm64/v8
47+
push: true
48+
tags: |
49+
ghcr.io/rails-lambda/live-development:latest
50+
ghcr.io/rails-lambda/live-development:1

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
FROM ghcr.io/rails-lambda/live-development-builder:${TARGETARCH} as builder
2+
COPY bin/build /usr/local/bin/build-live-development
3+
RUN build-live-development
4+
15
FROM scratch
26
LABEL org.opencontainers.image.source "https://github.com/rails-lambda/live-development"
37
LABEL org.opencontainers.image.description "Live Lambda Development | Tailscale Proxy"
4-
COPY ./opt /opt
8+
COPY --from=builder /workspaces/live-development/opt /opt

bin/package

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
#!/bin/sh
22
set -e
33

4-
docker login ghcr.io -u $GHCR_USER -p $GHCR_TOKEN
54
BASE_NAME="ghcr.io/rails-lambda/live-development"
65

6+
echo $GHCR_TOKEN | docker login ghcr.io --username $GHCR_USER --password-stdin
7+
8+
docker images --format '{{.ID}}' lamby_benchmark_devcontainer_app
9+
10+
11+
12+
echo 'Manifest create'
713
docker manifest create \
814
"${BASE_NAME}:latest" \
915
--amend "${BASE_NAME}-amd64:latest" \
1016
--amend "${BASE_NAME}-arm64:latest"
1117

12-
docker manifest push "${BASE_NAME}:latest"
18+
echo 'Manifest push'
19+
docker manifest push --insecure "${BASE_NAME}:latest"

bin/package-platform

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#!/bin/sh
22
set -e
33

4-
docker login ghcr.io -u $GHCR_USER -p $GHCR_TOKEN
54
BASE_NAME="ghcr.io/rails-lambda/live-development"
65

76
PLATFORM=$1
7+
PLATFORM_NAME=$(echo $PLATFORM | cut -d'/' -f1)
88

99
docker build \
1010
--platform "linux/${PLATFORM}" \
11-
--tag "${BASE_NAME}-${PLATFORM}:latest" \
11+
--tag "${BASE_NAME}-${PLATFORM_NAME}:latest" \
1212
--file Dockerfile .
13-
14-
docker push "${BASE_NAME}-${PLATFORM}:latest"

0 commit comments

Comments
 (0)