This repository was archived by the owner on Jun 22, 2024. It is now read-only.
forked from SeleniumHQ/docker-selenium
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathbuild-and-deploy-firefox-multi-arch.sh
47 lines (35 loc) · 1.82 KB
/
build-and-deploy-firefox-multi-arch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
DOCKERDEB=false # if using Docker Desktop, set to false
# if [[ $DOCKERDEB == true ]]
# then
# echo 'Getting geckodriver binary from the Docker Debian VM...'
# sh get-geckodriver.sh
# else
# echo 'Getting geckodriver from /media/host...'
# cp /media/host/geckodriver .
# fi
echo 'Generate the Dockerfile.arm64...'
BUILD_DATE=$(date +'%Y%m%d')
VERSION=4.1.2
NAMESPACE=seleniarm
AUTHORS=SeleniumHQ,sj26,jamesmortensen
ARCH=linux/arm64,linux/amd64,linux/arm/v7
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
echo FROM ${NAMESPACE}/node-base:${VERSION}-${BUILD_DATE} >> ./Dockerfile
echo LABEL authors="$AUTHORS" >> ./Dockerfile
echo "" >> ./Dockerfile
cat ./Dockerfile.arm64 >> ./Dockerfile
echo "Building Seleniarm/NodeFirefox:$VERSION-$BUILD_DATE"
docker buildx build --push --platform $ARCH -f Dockerfile -t $NAMESPACE/node-firefox:$VERSION-$BUILD_DATE .
#docker tag $NAMESPACE/node-firefox:$VERSION-$BUILD_DATE $NAMESPACE/node-firefox:latest
# Generate the Seleniarm/StandaloneFirefox Dockerfile
cd ../Standalone && sh generate.sh StandaloneFirefox node-firefox $VERSION-$BUILD_DATE $NAMESPACE $AUTHORS
cd ../StandaloneFirefox
echo "Building Seleniarm/StandaloneFirefox:$VERSION-$BUILD_DATE"
docker buildx build --push --platform $ARCH -f Dockerfile -t $NAMESPACE/standalone-firefox:$VERSION-$BUILD_DATE .
#docker tag $NAMESPACE/standalone-firefox:$VERSION-$BUILD_DATE $NAMESPACE/standalone-firefox:latest
# Remove geckodriver image and dependencies if build is successful, since it's 4.9GB!
# docker image rm local-seleniarm/geckodriver-arm64:$VERSION-$BUILD_DATE