In Docker, TARGETARCH is a built-in build argument that represents the target architecture (e.g., linux/amd64, linux/arm64, etc.) for the image you are building. This is particularly useful when building multi-architecture images using Docker’s Buildx feature.
#!/bin/bash# Make sure the builder containers are installed, created, and registered by running:# docker run --privileged --rm tonistiigi/binfmt --install all# docker buildx create --name mybuilder --use --bootstrap# docker buildx use mybuilder# Choose one of the options below#TODO: update so the build script takes arguments for load vs push and the tag name# Can't use load with multiple platforms at once so specify the version you want (linux/amd64 or linux/arm64)#docker buildx build --platform=linux/amd64 -t mwoodward6/nekton:humble --load .# generate and push both versions to dockerhub, make sure to set the tagdocker buildx build --platform linux/amd64,linux/arm64 -t mwoodward6/nekton:humble --push .
start.sh
start.sh
#!/bin/bash# Check if $DISPLAY is not already set by existing install or WSL on Windows 11if [[ -z "${DISPLAY}" ]]; then # if MacOS if [[ "$OSTYPE" =~ ^darwin ]]; then export DISPLAY=host.docker.internal:0; # WSL on Windows 10 else export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0; fifi#launch the nekton containerdocker-compose up -d;docker exec -it nekton /bin/bash;docker-compose stop;
docker-compose.yml
docker-compose.yml
---version: "2"services: nekton: image: mwoodward6/nekton:humble container_name: nekton environment: - DISPLAY=:1.0 - USER=root volumes: - <PATH_GOES_HERE>:/nekton_ws/src/NektonSoftware # Replace <PATH_GOES_HERE> with the path to NektonSoftware (If you cloned it to your home directory in WSL this would be ~/NektonSoftware) ports: - 6080:80 - 5900:5900 - 9090:9090 - 8080:8080 tty: true restart: unless-stopped