Skip to content

Commit

Permalink
Let docker build output eap-file (#164)
Browse files Browse the repository at this point in the history
* Let docker build output eap-file

---------

Co-authored-by: madelen-at-work <[email protected]>
  • Loading branch information
madelen-at-work and madelen-at-work authored Apr 2, 2024
1 parent f218354 commit 6bdcea5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ name: Sign and prerelease
on:
push:
branches:
- 'main'
- "main"
tags:
# semver, e.g. 1.2.0 (does not match 0.1.2)
- '[1-9]+.[0-9]+.[0-9]+'
- "[1-9]+.[0-9]+.[0-9]+"
# semver with prerelease info, e.g. 1.0.2-beta.1 or 1.2.3-rc.10
- '[1-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+'
- "[1-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+"
# do not match prerelease starting w/ 0, e.g. 1.0.2-beta.0 or 1.2.3-rc.01
- '![1-9]+.[0-9]+.[0-9]+-[a-z]+.[0]*'
- "![1-9]+.[0-9]+.[0-9]+-[a-z]+.[0]*"
# semver with date info, e.g. 1.0.2-20221125
- '[1-9]+.[0-9]+.[0-9]+-[0-9]+'
- "[1-9]+.[0-9]+.[0-9]+-[0-9]+"
# do not match date starting w/ 0, e.g. 1.0.2-01232023
- '![1-9]+.[0-9]+.[0-9]+-[0]*'
- "![1-9]+.[0-9]+.[0-9]+-[0]*"
pull_request:
branches:
- 'main'
- "main"

jobs:
# Builds docker ACAP using the build.sh script, then signs the eap-file in
Expand All @@ -43,8 +43,8 @@ jobs:
uses: ./.github/actions/metadata-action
with:
suffix: -${{ matrix.arch }}
repository: 'docker-acap'
get_version: 'true'
repository: "docker-acap"
get_version: "true"
- name: Update manifest file
if: ( github.ref_type == 'tag')
uses: ./.github/actions/update-acap-manifest-action
Expand All @@ -58,6 +58,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: ACAPARCH=${{ matrix.arch }}
target: "build"
- name: Set name of EAP-file
id: get_eap_file_name
run: |
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ RUN <<EOF
EOF

ENTRYPOINT [ "/opt/axis/acapsdk/sysroots/x86_64-pokysdk-linux/usr/bin/eap-install.sh" ]

FROM scratch AS binaries

COPY --from=build /opt/app/*.eap /
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,12 @@ To build the Docker ACAP use docker buildx with the provided Dockerfile:

```sh
# Build Docker ACAP image
docker buildx build --file Dockerfile --tag docker-acap:<ARCH> --build-arg ACAPARCH=<ARCH> .
docker buildx build --file Dockerfile --tag docker-acap:<ARCH> --build-arg ACAPARCH=<ARCH> --output <build-folder> .
```

where `<ARCH>` is either `armv7hf` or `aarch64`.

To extract the Docker ACAP eap-file use docker cp to copy it to a `build` folder:

```sh
docker cp "$(docker create "docker-acap:<ARCH>")":/opt/app/ ./build
```
where `<ARCH>` is either `armv7hf` or `aarch64`. `<build-folder>` is the path to an output folder
on your machine, eg. `build`. This will be created for you if not already existing.
Once the build has completed the Docker ACAP eap-file can be found in the `<build-folder>`.

## Installing a locally built Docker ACAP

Expand Down
5 changes: 2 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ docker buildx build --build-arg ACAPARCH="$arch" \
--file Dockerfile \
$progress_arg \
$cache_arg \
--tag "$imagetag" .

docker cp "$(docker create "$imagetag")":/opt/app/ ./build-"$arch"
--tag "$imagetag" \
--output build-"$arch" .

0 comments on commit 6bdcea5

Please sign in to comment.