Skip to content

Commit

Permalink
[Docker] Release DockerSlim images
Browse files Browse the repository at this point in the history
Signed-off-by: dm4 <[email protected]>
  • Loading branch information
dm4 committed Jul 11, 2022
1 parent 0b00440 commit 0122229
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/IWYU_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
image: fedora:latest

steps:
- name: Install requirments
- name: Install requirements
run: |
dnf update -y
dnf install -y cmake ninja-build boost llvm llvm-devel lld-devel clang git file rpm-build dpkg-dev clang-devel
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
container:
image: fedora:latest
steps:
- name: Install requirment
- name: Install requirements
run: |
dnf update -y
dnf install -y cmake ninja-build boost llvm llvm-devel lld-devel clang git file rpm-build dpkg-dev
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
container:
image: fedora:rawhide
steps:
- name: Install requirment
- name: Install requirements
run: |
dnf update -y
dnf install -y git gcc-c++ cmake ninja-build boost-devel spdlog-devel llvm-devel lld-devel rpm-build
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: release-published

# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
on:
release:
types: [published]

jobs:
get_version:
name: Retrieve version information
runs-on: ubuntu-latest
outputs:
version: ${{ steps.prep.outputs.version }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get version
id: prep
run: |
# Retrieve annotated tags. Details: https://github.com/actions/checkout/issues/290
git fetch --tags --force
echo "Set version: $(git describe --match "[0-9].[0-9]*" --tag)"
echo ::set-output name=version::$(git describe --match "[0-9].[0-9]*" --tag)
build_docker_slim_images:
name: Build DockerSlim Images
needs: [get_version]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install requirements
run: |
curl -sL https://raw.githubusercontent.com/docker-slim/docker-slim/master/scripts/install-dockerslim.sh | sudo -E bash -
- name: Prepare docker env
id: docker_env
run: |
echo ::set-output name=docker_image::wasmedge/wasmedge:release-${{ needs.get_version.outputs.version }}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Run docker-slim
run: |
docker-slim build \
--dockerfile Dockerfile.release \
--dockerfile-context utils/docker \
--tag ${{ steps.docker_env.outputs.docker_image }} \
--http-probe-off \
--include-bin /usr/local/bin/wasmedge \
--include-bin /usr/local/bin/wasmedgec \
--cbo-build-arg VERSION="${{ needs.get_version.outputs.version }}" \
--cbo-label org.opencontainers.image.title="${{ github.event.repository.name }}" \
--cbo-label org.opencontainers.image.description="${{ github.event.repository.description }}" \
--cbo-label org.opencontainers.image.url="${{ github.event.repository.html_url }}" \
--cbo-label org.opencontainers.image.source="${{ github.event.repository.clone_url }}" \
--cbo-label org.opencontainers.image.version="${{ needs.get_version.outputs.version }}" \
--cbo-label org.opencontainers.image.created="${{ steps.docker_env.outputs.created }}" \
--cbo-label org.opencontainers.image.revision="${{ github.sha }}" \
--cbo-label org.opencontainers.image.licenses="${{ github.event.repository.license.spdx_id }}"
- name: Push to DockerHub
run: |
docker push ${{ steps.docker_env.outputs.docker_image }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install requirment
- name: Install requirements
run: |
dnf update -y
dnf install -y git gcc-c++ cmake ninja-build boost-devel spdlog-devel llvm-devel lld-devel rpm-build
Expand Down
10 changes: 10 additions & 0 deletions utils/docker/Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ubuntu:20.04
ARG VERSION
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && \
apt install -y curl git && \
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -p /usr/local -e all -v $VERSION

WORKDIR /app
CMD ["/usr/local/bin/wasmedge"]

0 comments on commit 0122229

Please sign in to comment.