diff --git a/.github/workflows/docker_in_docker.yml b/.github/workflows/docker_in_docker.yml new file mode 100644 index 00000000..dda03e37 --- /dev/null +++ b/.github/workflows/docker_in_docker.yml @@ -0,0 +1,33 @@ +name: Test Docker on GitHub Actions + +on: + workflow_dispatch: + inputs: + message: + description: 'Build as described in README.md' + push: + branches: + - 'tudor/feat-docker-action' + +jobs: + build_from_scratch: + runs-on: ubuntu-latest + services: + docker: + image: docker:dind + options: --privileged + container: + image: ubuntu:22.04 + steps: + - name: Install Docker + run: | + apt-get update + apt-get install -y docker.io + + - name: DinD run + run: | + docker run -v /var/run/docker.sock:/var/run/docker.sock node:20 bash -c "apt update && apt install -y git wget curl docker.io &&\ + wget -qO- https://get.pnpm.io/install.sh | ENV=\"$HOME/.bashrc\" SHELL=\"$(which bash)\" bash - && source /$HOME/.bashrc &&\ + git clone --single-branch --branch tudor/feat-docker-action https://github.com/electric-sql/pglite.git &&\ + cd pglite &&\ + pnpm install && pnpm build:all" diff --git a/cibuild/build-with-docker.sh b/cibuild/build-with-docker.sh index adfcaf8e..954495d0 100755 --- a/cibuild/build-with-docker.sh +++ b/cibuild/build-with-docker.sh @@ -16,7 +16,9 @@ IMG_NAME="electricsql/pglite-builder" IMG_TAG="${PG_VERSION}_${SDK_VERSION}" SDK_ARCHIVE="${SDK_ARCHIVE:-python3.13-wasm-sdk-Ubuntu-22.04.tar.lz4}" WASI_SDK_ARCHIVE="${WASI_SDK_ARCHIVE:-python3.13-wasi-sdk-Ubuntu-22.04.tar.lz4}" +VOL="${VOL:-$(pwd)/packages/pglite}" +# -v "/$(pwd)/packages/pglite:/workspace/packages/pglite:rw" \ docker run \ --rm \ -e OBJDUMP=${OBJDUMP:-true} \ @@ -28,6 +30,6 @@ docker run \ -v "/$(pwd)/cibuild:/workspace/cibuild:rw" \ -v "/$(pwd)/patches:/opt/patches:rw" \ -v "/$(pwd)/tests:/workspace/tests:rw" \ - -v "/$(pwd)/packages/pglite:/workspace/packages/pglite:rw" \ + -v $VOL:/workspace/packages/pglite:rw \ $IMG_NAME:$IMG_TAG \ - bash ./cibuild/build-all.sh \ No newline at end of file + bash /workspace/cibuild/build-all.sh