A collection of tools for building the devcontainer and sidecar docker images used by the FarmData2 development environment.
- Create a new Codespace from this repository (or from your own fork).
- Follow the relevant directions below.
The devcontainer image is the main image used in FarmData2 development environment either in a Codespace or in VSCode. It contains all of the necessary dependencies for setting up the development environment and running the sidecar containers.
cd devcontainer(Note: Not.devcontainer).- Edit
repo.txtindevcontainerto update the version number for the image. docker image lsdocker image rm ...- Remove all images to ensure there is sufficent disk space for the build.
- If disk space issues still arrise use:
docker system prune -a --volumes -f
./preBuildDevcontainer.bash- Options include:
--debug(-d) - will build just theamd64image and will not push to dockerhub.--amd64(-a) - will build theamd64image and push it to dockerhub. This is the default behavior if no option is specified.--no-cache(-n) - will not use the Docker build cache.--help(-h) - will display information about all options.
- Options include:
- Edit and commit the
.devcontainer/devcontainer.jsonfile inFarmData2to use the new image spedified inrepo.txt.
The sidecar images provide the services necessary to run farmOS and thus FarmData2. These include the postgres database, the farmOS server and an nginx reverse proxy to provide access to farmOS via https.
The following command will build the image described by the Dockerfile in <dir> for the architecture of the host machine.
cd sidecarContainers
./build-images.bash -d <dir>
For example, the following command builds the farmos3 image locally for the architecture of the host machine:
./build-images.bash -d farmos3
Multiple images can be built with a single command by listing each of their directory names. For example, the following command builds the farmos3 and the postgres images:
./build-images.bash -d farmos3 postgres
To build multi architecture images:
- Use
docker loginto log into dockerhub asfarmdata2. - Use the commands as above but:
- omit the
-dflag. - add the
-pflag.
- omit the
cd sidecarContainers
./build-images.bash -p fd2dev
Notes:
- Logging in to dockerhub as
farmdata2requires authentication that is available only to project maintainers. - To modify the architectures for which images are built edit the
PLATFORMSvariable in thebuild-images.bashscript.