Skip to content

Commit

Permalink
test with docker in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor committed Dec 2, 2024
1 parent 1f7eed9 commit 29533e8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docker_in_docker.yml
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 4 additions & 2 deletions cibuild/build-with-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand All @@ -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
bash /workspace/cibuild/build-all.sh

0 comments on commit 29533e8

Please sign in to comment.