Skip to content

Commit 2ef83e1

Browse files
author
Andras Fekete
committed
Update buildAndPush.sh and README.md
1 parent 0571040 commit 2ef83e1

2 files changed

Lines changed: 29 additions & 6 deletions

File tree

Docker/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ This is a Docker environment for compiling, testing and running WolfSSL. Use `ru
33

44
When the compilation and tests succeed, you will be dropped in to a shell environment within the container. This can be useful to build other things within the environment. Additional tests can be run as well as debugging of code.
55

6+
# Docker Hub
7+
These images are also uploaded to the wolfSSL's [Docker Hub page](https://hub.docker.com/orgs/wolfssl/repositories). There is a convenience script here `buildAndPush.sh` that will create the appropriate containers and push them to the repo.
8+
69
# FAQ
710
## permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
811
You need to be added to the `docker` group to run Docker containers. Run `sudo usermod -aG docker $USER`. You may need to restart the Docker daemon.
912

1013
## Unable to access symlinked files outside of WolfSSL
1114
The volume mounted in the Docker container needs to have all files that your compilation will need. To solve this, you have a couple options:
1215
1. Change the `WOLFSSL_DIR` variable in the `run.sh` to one higher up (by adding `/..` to the path). Then update the `docker build` to include the correct path to the Dockerfile and the `docker run` argument to the working directory (`-w`) to the WolfSSL source directory
13-
2. Move the external repository to within the WolfSSL directory. For example create an `external` folder which has your files. This route may have complications when stashing Git work.
16+
2. Move the external repository to within the WolfSSL directory. For example create an `external` folder which has your files. This route may have complications when stashing Git work.

Docker/buildAndPush.sh

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,33 @@ if [ "${DOCKER_BASE_IMAGE}" != "" ]; then
55
DOCKER_BUILD_OPTIONS+=" --build-arg DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}"
66
fi
77

8+
NUM_FAILURES=0
9+
810
CUR_DATE=$(date -u +%F)
911
echo "Building wolfssl/wolfssl-builder:${CUR_DATE} as ${DOCKER_BUILD_OPTIONS}"
1012
docker build -t wolfssl/wolfssl-builder:${CUR_DATE} ${DOCKER_BUILD_OPTIONS} "${WOLFSSL_DIR}/Docker" && \
11-
docker push wolfssl/wolfssl-builder:${CUR_DATE} && \
1213
docker tag wolfssl/wolfssl-builder:${CUR_DATE} wolfssl/wolfssl-builder:latest && \
13-
docker push wolfssl/wolfssl-builder:latest && \
1414
docker build --build-arg DOCKER_BASE_IMAGE=wolfssl/wolfssl-builder:${CUR_DATE} -t wolfssl/testing-cross-compiler:${CUR_DATE} "${WOLFSSL_DIR}/Docker" -f Dockerfile.cross-compiler && \
15-
docker push wolfssl/testing-cross-compiler:${CUR_DATE} && \
16-
docker tag wolfssl/testing-cross-compiler:${CUR_DATE} wolfssl/testing-cross-compiler:latest && \
17-
docker push wolfssl/testing-cross-compiler:latest
15+
docker tag wolfssl/testing-cross-compiler:${CUR_DATE} wolfssl/testing-cross-compiler:latest
16+
17+
if [ $? -eq 0 ]; then
18+
echo "Pushing containers to DockerHub"
19+
docker push wolfssl/wolfssl-builder:${CUR_DATE} && docker push wolfssl/wolfssl-builder:latest && \
20+
docker push wolfssl/testing-cross-compiler:${CUR_DATE} && docker push wolfssl/testing-cross-compiler:latest
21+
else
22+
echo "Warning: Build wolfssl/wolfssl-builder failed. Continuing"
23+
((NUM_FAILURES++))
24+
fi
25+
26+
echo "Building wolfssl/wolfCLU:${CUR_DATE}"
27+
docker build --pull --build-arg DUMMY=${CUR_DATE} -t wolfssl/wolfclu:${CUR_DATE} "${WOLFSSL_DIR}/Docker/wolfCLU" && \
28+
docker tag wolfssl/wolfclu:${CUR_DATE} wolfssl/wolfclu:latest
29+
if [ $? -eq 0 ]; then
30+
echo "Pushing containers to DockerHub"
31+
docker push wolfssl/wolfclu:${CUR_DATE} && docker push wolfssl/wolfclu:latest
32+
else
33+
echo "Warning: Build wolfssl/wolfclu failed. Continuing"
34+
((NUM_FAILURES++))
35+
fi
36+
37+
echo "Script completed in $SECONDS seconds. Had $NUM_FAILURES failures."

0 commit comments

Comments
 (0)