diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..a2ba9d90a91 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,37 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "Bluefin-devcontainer", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "workspaceFolder": "${localWorkspaceFolder}", + "workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind", + "mounts": [{ "source": "/tmp", "target": "/tmp", "type": "bind" }], + "otherPortsAttributes": { "onAutoForward" : "ignore" }, + "customizations": { + "vscode": { + "extensions": [ + "eamodio.gitlens", + "hangxingliu.vscode-systemd-support", + "mads-hartmann.bash-ide-vscode", + "ms-azuretools.vscode-docker", + "sclu1034.justfile", + "timonwong.shellcheck" + ] + } + }, + // Likely need to add "--userns=keep-id, --group-add=keep-groups" for podman support + "runArgs": ["--init"], + "securityOpt": [ + "label=disable" + ], + "features": { + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, + "ghcr.io/guiyomh/features/just:0": {}, + "ghcr.io/lukewiwa/features/shellcheck:0": {}, + "ghcr.io/jsburckhardt/devcontainer-features/skopeo:1": {} + }, + "onCreateCommand": { + "bash-completions": "sudo apt-get install -y bash-completion; echo 'source /etc/profile.d/bash_completion.sh' | sudo tee -a /etc/bash.bashrc > /dev/null", + "just-completions": "just --completions bash | sudo tee -a /etc/bash_completion.d/just > /dev/null", + "docker-completions": "docker completion bash | sudo tee -a /etc/bash_completion.d/docker.sh > /dev/null" + } +} diff --git a/Justfile b/Justfile index 04744c3139b..08486315f45 100644 --- a/Justfile +++ b/Justfile @@ -28,6 +28,7 @@ tags := '( export SUDO_DISPLAY := if `if [ -n "${DISPLAY:-}" ] || [ -n "${WAYLAND_DISPLAY:-}" ]; then echo true; fi` == "true" { "true" } else { "false" } export SUDOIF := if `id -u` == "0" { "" } else { if SUDO_DISPLAY == "true" { "sudo --askpass" } else { "sudo" } } export PODMAN := if path_exists("/usr/bin/podman") == "true" { env("PODMAN", "/usr/bin/podman") } else { if path_exists("/usr/bin/docker") == "true" { env("PODMAN", "docker") } else { env("PODMAN", "exit 1 ; ") } } +export PULL_POLICY := if PODMAN =~ "docker" { "missing" } else { "newer" } [private] default: @@ -226,7 +227,7 @@ build $image="bluefin" $tag="latest" $flavor="main" rechunk="0" ghcr="0" pipelin "${BUILD_ARGS[@]}" \ "${LABELS[@]}" \ --target "${target}" \ - --tag "${image_name}:${tag}" \ + --tag localhost/"${image_name}:${tag}" \ --file Containerfile \ . echo "::endgroup::" @@ -346,7 +347,7 @@ rechunk $image="bluefin" $tag="latest" $flavor="main" ghcr="0" pipeline="0": # Run Rechunker's Prune ${SUDOIF} ${PODMAN} run --rm \ - --pull=newer \ + --pull=${PULL_POLICY} \ --security-opt label=disable \ --volume "$MOUNT":/var/tree \ --env TREE=/var/tree \ @@ -379,7 +380,7 @@ rechunk $image="bluefin" $tag="latest" $flavor="main" ghcr="0" pipeline="0": # Run Rechunker ${SUDOIF} ${PODMAN} run --rm \ - --pull=newer \ + --pull=${PULL_POLICY} \ --security-opt label=disable \ --volume "$PWD:/workspace" \ --volume "$PWD:/var/git" \ @@ -559,7 +560,7 @@ build-iso $image="bluefin" $tag="latest" $flavor="main" ghcr="0" pipeline="0": # Build ISO iso_build_args=() - iso_build_args+=("--rm" "--privileged" "--pull=newer") + iso_build_args+=("--rm" "--privileged" "--pull=${PULL_POLICY}") if [[ "{{ ghcr }}" == "0" ]]; then iso_build_args+=(--volume "/var/lib/containers/storage:/var/lib/containers/storage") fi @@ -620,7 +621,7 @@ run-iso $image="bluefin" $tag="latest" $flavor="main": echo "Connect to http://localhost:${port}" run_args=() run_args+=(--rm --privileged) - run_args+=(--pull=newer) + run_args+=(--pull=${PULL_POLICY}) run_args+=(--publish "127.0.0.1:${port}:8006") run_args+=(--env "CPU_CORES=4") run_args+=(--env "RAM_SIZE=8G")