-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use docker buildx to target different archtitectures - Added cmdline.sh for command-line option handling
- Loading branch information
Showing
10 changed files
with
84 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,39 @@ | ||
# builder image to build the audiowaveform RPM | ||
FROM amazonlinux:2 | ||
# Use docker build --build-arg AUDIOWAVEFORM_VERSION=<git-revision> | ||
# --build-arg AUDIOWAVEFORM_PACKAGE_VERSION=<version> | ||
# --build-arg AMAZON_RELEASE=<release> | ||
# --build-arg ARCH=<x86_64|aarch64> | ||
|
||
# Use docker build --build-arg AUDIOWAVEFORM_VERSION=<git-revision> AUDIOWAVEFORM_PACKAGE_VERSION=<version> | ||
ARG AUDIOWAVEFORM_VERSION | ||
ENV AUDIOWAVEFORM_VERSION=${AUDIOWAVEFORM_VERSION} | ||
ARG AMAZON_RELEASE | ||
FROM amazonlinux:${AMAZON_RELEASE} | ||
|
||
ARG AUDIOWAVEFORM_VERSION | ||
ARG AUDIOWAVEFORM_PACKAGE_VERSION | ||
ENV AUDIOWAVEFORM_PACKAGE_VERSION=${AUDIOWAVEFORM_PACKAGE_VERSION} | ||
ARG AMAZON_RELEASE | ||
ARG ARCH | ||
|
||
# Use the epel repository (to provide the libmad package) | ||
RUN amazon-linux-extras install epel && \ | ||
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ | ||
yum install -y redhat-lsb-core | ||
|
||
# Install audiowaveform build dependencies | ||
RUN INSTALL_PKGS="rpm-build wget git make cmake gcc-c++ libmad-devel libid3tag-devel libsndfile-devel gd-devel boost-devel libmad-devel" && \ | ||
RUN INSTALL_PKGS="rpm-build wget make cmake3 gcc-c++ libmad-devel libid3tag-devel libsndfile-devel gd-devel boost-devel" && \ | ||
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && \ | ||
yum clean all -y | ||
|
||
RUN yum update -y | ||
|
||
# Retrieve and build source (see https://github.com/bbc/audiowaveform#building-from-source) | ||
WORKDIR /usr/local/src | ||
WORKDIR /root | ||
|
||
RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSION}.tar.gz | tar xfz - && \ | ||
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \ | ||
mkdir build && \ | ||
cd build && \ | ||
cmake -D ENABLE_TESTS=0 .. && \ | ||
cmake3 -D ENABLE_TESTS=0 .. && \ | ||
make && \ | ||
cpack -G RPM | ||
cpack3 -G RPM | ||
|
||
WORKDIR /usr/local/src/audiowaveform-${AUDIOWAVEFORM_VERSION}/build | ||
WORKDIR /root/audiowaveform-${AUDIOWAVEFORM_VERSION}/build | ||
|
||
RUN mv audiowaveform-${AUDIOWAVEFORM_PACKAGE_VERSION}-1.x86_64.rpm audiowaveform-${AUDIOWAVEFORM_PACKAGE_VERSION}-1.amzn2.x86_64.rpm | ||
RUN mv audiowaveform-${AUDIOWAVEFORM_PACKAGE_VERSION}-1.${ARCH}.rpm audiowaveform-${AUDIOWAVEFORM_PACKAGE_VERSION}-1.amzn${AMAZON_RELEASE}.${ARCH}.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
#!/bin/sh -x | ||
#!/bin/bash | ||
# | ||
# Create compile_audiowaveform Docker image, copy results to this directory | ||
# Create Docker image, copy results to this directory | ||
# and remove the image afterwards | ||
|
||
set -e | ||
|
||
AUDIOWAVEFORM_VERSION=1.8.1 | ||
AUDIOWAVEFORM_PACKAGE_VERSION=1.8.1 | ||
source ./cmdline.sh | ||
|
||
IMAGE=audiowaveform_rpm | ||
docker build -t $IMAGE -f Dockerfile-amazon-linux-2 --build-arg AUDIOWAVEFORM_VERSION=${AUDIOWAVEFORM_VERSION} --build-arg AUDIOWAVEFORM_PACKAGE_VERSION=${AUDIOWAVEFORM_PACKAGE_VERSION} . | ||
CONTAINER_ID=`docker create $IMAGE` | ||
docker cp $CONTAINER_ID:/usr/local/src/audiowaveform-${AUDIOWAVEFORM_VERSION}/build/audiowaveform-${AUDIOWAVEFORM_PACKAGE_VERSION}-1.amzn2.x86_64.rpm . | ||
docker rm -v $CONTAINER_ID | ||
docker rmi $IMAGE | ||
AMAZON_RELEASE=2 | ||
ARCH=x86_64 | ||
|
||
set -x | ||
|
||
docker buildx build \ | ||
--progress plain \ | ||
--platform linux/${ARCH} \ | ||
--tag ${IMAGE} \ | ||
--file Dockerfile-amazon-linux-${AMAZON_RELEASE} \ | ||
--build-arg AUDIOWAVEFORM_VERSION=${AUDIOWAVEFORM_VERSION} \ | ||
--build-arg AUDIOWAVEFORM_PACKAGE_VERSION=${AUDIOWAVEFORM_PACKAGE_VERSION} \ | ||
--build-arg AMAZON_RELEASE=${AMAZON_RELEASE} \ | ||
--build-arg ARCH=${ARCH} . | ||
CONTAINER_ID=`docker create ${IMAGE}` | ||
docker cp ${CONTAINER_ID}:/root/audiowaveform-${AUDIOWAVEFORM_VERSION}/build/audiowaveform-${AUDIOWAVEFORM_PACKAGE_VERSION}-1.amzn${AMAZON_RELEASE}.${ARCH}.rpm . | ||
docker rm -v ${CONTAINER_ID} | ||
docker rmi ${IMAGE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
#!/bin/sh -x | ||
#!/bin/bash | ||
# | ||
# Create compile_audiowaveform Docker image, copy results to this directory | ||
# Create Docker image, copy results to this directory | ||
# and remove the image afterwards | ||
|
||
set -e | ||
|
||
AUDIOWAVEFORM_VERSION=6bec021446bcc8f9da981158130fb200d9fc040a | ||
AUDIOWAVEFORM_PACKAGE_VERSION=1.8.1 | ||
source ./cmdline.sh | ||
|
||
if [ -z "${ARCH}" ] | ||
then | ||
echo "Missing architecture (x86_64 or aarch64)" | ||
exit 1 | ||
fi | ||
|
||
IMAGE=audiowaveform_rpm | ||
CENTOS_RELEASE=7 | ||
ARCH=aarch64 | ||
|
||
docker build \ | ||
set -x | ||
|
||
docker buildx build \ | ||
--progress plain \ | ||
--platform linux/${ARCH} \ | ||
--tag ${IMAGE} \ | ||
--file Dockerfile-centos${CENTOS_RELEASE} \ | ||
--build-arg AUDIOWAVEFORM_VERSION=${AUDIOWAVEFORM_VERSION} \ | ||
--build-arg AUDIOWAVEFORM_PACKAGE_VERSION=${AUDIOWAVEFORM_PACKAGE_VERSION} \ | ||
--build-arg CENTOS_RELEASE=${CENTOS_RELEASE} \ | ||
--build-arg ARCH=${ARCH} . | ||
CONTAINER_ID=`docker create $IMAGE` | ||
docker cp $CONTAINER_ID:/root/audiowaveform-${AUDIOWAVEFORM_VERSION}/build/audiowaveform-${AUDIOWAVEFORM_PACKAGE_VERSION}-1.el7.${ARCH}.rpm . | ||
docker rm -v $CONTAINER_ID | ||
docker rmi $IMAGE | ||
CONTAINER_ID=`docker create ${IMAGE}` | ||
docker cp ${CONTAINER_ID}:/root/audiowaveform-${AUDIOWAVEFORM_VERSION}/build/audiowaveform-${AUDIOWAVEFORM_PACKAGE_VERSION}-1.el7.${ARCH}.rpm . | ||
docker rm -v ${CONTAINER_ID} | ||
docker rmi ${IMAGE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters