diff --git a/INSTALL.md b/INSTALL.md
index 250d2cd0..f0f9530f 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -36,7 +36,7 @@ Full installation details for these tools are provided by the projects themselve
- You'll be using a *WSL Terminal* for many of the steps below.
- Then follow the instructions for installing [Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/). Be sure to follow the directions for the "WSL 2 backend" (not the "Hyper-V backend").
- For MacOS:
- - Follow the instructions for installing [Docker Desktop for Mac](https://docs.docker.com/desktop/install/mac-install/). Be sure to choose chose "Mac with Intel Chip" or "Mac with Apple Silicon" as appropriate for your Mac. If you are unsure, choose "About this Mac" from the Apple menu and check which "Chip" is in your Mac (Intel or Apple).
+ - Follow the instructions for installing [Docker Desktop for Mac](https://docs.docker.com/desktop/install/mac-install/). Be sure to choose "Mac with Intel Chip" or "Mac with Apple Silicon" as appropriate for your Mac. If you are unsure, choose "About this Mac" from the Apple menu and check which "Chip" is in your Mac (Intel or Apple).
- For Linux:
- Follow the instructions for installing [Docker Desktop for Linux](https://docs.docker.com/desktop/install/linux-install/).
- Test your installation of Docker Desktop.
diff --git a/docker/api/Dockerfile b/docker/api/Dockerfile
index 1514a6d1..366e7d29 100644
--- a/docker/api/Dockerfile
+++ b/docker/api/Dockerfile
@@ -3,9 +3,11 @@ FROM node:alpine3.17
WORKDIR /app
-# Get the package.json and install dependencies
-COPY package.json .
-RUN npm install
+# Get the package.json, package-lock.json and install the dependencies
+# NOTE: Use npm ci here so that we use package-lock.json and
+# so that we are alerted if there are any changes.
+COPY package.json package-lock.json ./
+RUN npm ci
# Start the express api hander.
CMD ["npm", "start"]
\ No newline at end of file
diff --git a/docker/api/after.bash b/docker/api/after.bash
index 43fa448e..53a77105 100644
--- a/docker/api/after.bash
+++ b/docker/api/after.bash
@@ -1,2 +1,3 @@
# Delete the package.json file that was copied into the build context.
-rm package.json
\ No newline at end of file
+rm package.json
+rm package-lock.json
\ No newline at end of file
diff --git a/docker/api/before.bash b/docker/api/before.bash
index 7e8ce85a..8e68c8b9 100644
--- a/docker/api/before.bash
+++ b/docker/api/before.bash
@@ -1,2 +1,3 @@
# Copy the package.json file to the build context.
-cp ../../farmdata2/farmdata2_api/package.json .
+cp ../../farmdata2/farmdata2_api/package.json ./
+cp ../../farmdata2/farmdata2_api/package-lock.json ./
\ No newline at end of file
diff --git a/docker/api/repo.txt b/docker/api/repo.txt
index 43ef8435..43ba32af 100644
--- a/docker/api/repo.txt
+++ b/docker/api/repo.txt
@@ -1 +1 @@
-api:fd2.1
+api:fd2.2
diff --git a/docker/build-images.bash b/docker/build-images.bash
index 3345cb42..ed74ce99 100755
--- a/docker/build-images.bash
+++ b/docker/build-images.bash
@@ -1,15 +1,26 @@
#!/bin/bash
-# Build and push to DockerHub multi architecture images
-# for all of the containers used by FarmData2.
+# Build and optionally push to DockerHub multi architecture images
+# or single architecture local images for FarmData2.
-LOGGED_IN=$(cat ~/.docker/config.json 2> /dev/null | grep "index.docker.io" | wc -l | cut -f 8 -d ' ')
-if [ "$LOGGED_IN" == "0" ];
-then
- echo "Please log into Docker Hub before building images."
- echo " Use: docker login"
- echo "This allows multi architecture images to be pushed."
- exit -1
+LOCAL_BUILD=0
+
+# Check for --local flag
+if [ "$1" == "--local" ]; then
+ LOCAL_BUILD=1
+ shift # Remove the --local argument
+fi
+
+# Check for Docker Hub login only if not a local build
+if [ "$LOCAL_BUILD" -eq 0 ]; then
+ LOGGED_IN=$(cat ~/.docker/config.json 2> /dev/null | grep "index.docker.io" | wc -l | cut -f 8 -d ' ')
+ if [ "$LOGGED_IN" == "0" ];
+ then
+ echo "Please log into Docker Hub before building images."
+ echo " Use: docker login"
+ echo "This allows multi architecture images to be pushed."
+ exit -1
+ fi
fi
if [ $# -lt 1 ];
@@ -21,19 +32,21 @@ then
exit -1
fi
-# Create the builder if it doesn't exist.
-FD2_BUILDER=$(docker buildx ls | grep "fd2builder" | wc -l | cut -f 8 -d ' ')
-if [ "$FD2_BUILDER" == "0" ];
-then
- echo "Making new builder for FarmData2 images."
- docker buildx create --name fd2builder
-fi
+# Create the builder if it doesn't exist and if not a local build
+if [ "$LOCAL_BUILD" -eq 0 ]; then
+ FD2_BUILDER=$(docker buildx ls | grep "fd2builder" | wc -l | cut -f 8 -d ' ')
+ if [ "$FD2_BUILDER" == "0" ];
+ then
+ echo "Making new builder for FarmData2 images."
+ docker buildx create --name fd2builder
+ fi
-# Switch to use the fd2builder.
-echo "Using the fd2bilder."
-docker buildx use fd2builder
+ # Switch to use the fd2builder.
+ echo "Using the fd2builder."
+ docker buildx use fd2builder
+fi
-# Build and push each of the images to Docker Hub.
+# Build (and push) each of the images
for IMAGE in "$@"
do
if [ ! -f $IMAGE/Dockerfile ] | [ ! -f $IMAGE/repo.txt ];
@@ -54,7 +67,14 @@ do
TAG=$(cat repo.txt)
REPO="farmdata2/$TAG"
echo " Performing docker build using tag $REPO ..."
- docker buildx build --platform linux/amd64,linux/arm64 -t $REPO --push .
+
+ if [ "$LOCAL_BUILD" -eq 1 ]; then
+ # Local build for the architecture of the local machine
+ docker build -t $REPO .
+ else
+ # Multi architecture build and push
+ docker buildx build --platform linux/amd64,linux/arm64 -t $REPO --push .
+ fi
if [ -f after.bash ];
then
diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile
index cd163f68..9fd44d32 100644
--- a/docker/dev/Dockerfile
+++ b/docker/dev/Dockerfile
@@ -49,6 +49,7 @@ RUN apt install -y --no-install-recommends \
&& npm install -g \
@vue/cli@5.0.8 \
jsdoc@3.6.7 \
+ jsdoc-escape-at \
jsdoc-vuejs@3.0.9 \
vue-template-compiler@2.6.14
@@ -142,7 +143,9 @@ RUN npm install -d \
@cypress/webpack-dev-server@2.5.0 \
@cypress/vue2@1.1.2 \
path@0.12.7 \
- axios@0.24.0
+ axios@0.24.0 \
+ bootstrap@3.3.7
+
WORKDIR /home/$USERNAME
# Configure the VNC server so that it allows fd2dev to connect without
diff --git a/docker/dev/bash_aliases b/docker/dev/bash_aliases
index 099c6f1c..62616baf 100644
--- a/docker/dev/bash_aliases
+++ b/docker/dev/bash_aliases
@@ -8,7 +8,7 @@ setDB ()
}
# Clear the drupal cache in the fd2_farmdata2 container.
-alias clearDupalCache="docker exec -it fd2_farmdata2 drush cc all"
+alias clearDrupalCache="docker exec -it fd2_farmdata2 drush cc all"
# Alias codium for running VSCodium with no-sandbox.
codium ()
diff --git a/docker/dev/repo.txt b/docker/dev/repo.txt
index 768cc8e6..4b73c190 100644
--- a/docker/dev/repo.txt
+++ b/docker/dev/repo.txt
@@ -1 +1 @@
-dev:fd2.3
+dev:fd2.4
diff --git a/docker/dev/startup.bash b/docker/dev/startup.bash
index 12a0807f..fb668436 100755
--- a/docker/dev/startup.bash
+++ b/docker/dev/startup.bash
@@ -1,36 +1,36 @@
#!/bin/bash
-# Cleanup from past vnc session that may hav been running in the container.
+# Cleanup from past VNC session that may have been running in the container.
# This clean-up is not done when the container is stopped (not deleted).
-rm /tmp/.X11-unix/X1
-rm /tmp/.X1-lock
+# Using `rm -f` to ignore nonexistent files and suppress error messages.
+rm -f /tmp/.X11-unix/X1
+rm -f /tmp/.X1-lock
-# Ensure that the fd2dev user is in a group that has RW permission to
-# the docker.sock file. This will allow fd2dev to use the docker on docker
-# to interact with containers within the development environment.
-# Note: This must be here instead of in Dockerfile so the GID for the
-# docker.sock in the container can match the one on the host.
-# Note: The docker.gid file is mounted into the container by docker-compose.
-HOST_DOCKER_GID=$(cat ~/.fd2/gids/docker.gid)
-HOST_DOCKER_GID_IN_CONTAINER=$(echo /etc/group | grep ":$HOST_DOCKER_GID:")
-if [ -z "$HOST_DOCKER_GID_IN_CONTAINER" ];
-then
- echo "fd2dev" | sudo -S groupadd --gid $HOST_DOCKER_GID fd2docker
+# The sudo password is assumed to be 'fd2dev' for all operations.
+# Using a single invocation of sudo and a here-document to execute multiple commands.
+# This reduces the number of times the password needs to be echoed and sudo is called.
+# This also reduces the script complexity and potential points of failure.
+sudo -S sh <
+
+