Don't download excluded container images
Is your feature request related to a problem? Please describe.
I'm running supabase start with the --exclude-containers flag in CI. Excluding containers is nice, but I'd also like to be able to skip downloading container images that will not be used at all.
Describe the solution you'd like
Excluded containers would not only skip running them, but also downloading them.
Which container do you think is unused? The database depends on service migrations from auth, storage, and realtime. So running supabase db start alone will require pulling 3 additional service images.
@sweatybridge that's a good point. I don't know how supabase internals work w.r.t. dependencies.
I'm running CI with --exclude realtime,storage-api,imgproxy,inbucket,edge-runtime with the goal of running minimal possible supabase instance that supports postgres + postgrest + auth (so probably more could be added).
To close this one off, you can now selectively disable services in supabase/config.toml to skip initialising those schemas on supabase start. This also means that images for disabled services won't be downloaded.
You don't need to specify --exclude flag anymore on npx supabase@beta start. Stable release will be updated next Tuesday.
Thank you for the update @sweatybridge. That is helpful (disabling a few services in config.toml has shaved ~30s from my CI runs!) but doesn't complete the issue imo.
It would be more flexible and intuitive to prevent container downloads (in addition to not running them) when the exclude flag is provided to supabase start.
A trivial example: Inbucket is very useful for local dev but often unused in CI. Assume the CI has a step to run supabase start -x inbucket. With the current implementation you have to choose between:
- version controlling config to represent local dev; resulting in CI downloading the inbucket container but not starting it
- version controlling config to represent CI; resulting in manual changes to
config.tomlby each dev when working locally
It would be more flexible and intuitive to prevent container downloads (in addition to not running them) when the exclude flag is provided to supabase start.
I think that's the current behaviour as well. For eg. if you enable inbucket in config.toml but disable it on CI with -x inbucket, the container image should not be downloaded.
But let me know if otherwise.
I re-enabled realtime and storage-api in my config (two of the services disabled to get the previously mentioned improvements) and re-ran the CI pipeline with supabase start -x realtime,storage-api. GitHub Actions logs shows it is still pulling the containers. Using Supabase CLI 1.187.10
v2.29.15: Pulling from supabase/realtime
...
Status: Downloaded newer image for public.ecr.aws/supabase/realtime:v2.29.15
v1.0.6: Pulling from supabase/storage-api
...
Status: Downloaded newer image for public.ecr.aws/supabase/storage-api:v1.0.6
Just wanted to report that some of the containers were excluded during the build phase but not all the ones I wanted excluded (like storage api)
Run supabase start --workdir ./turborepo/packages/supabase -x storage-api,imgproxy,studio,edge-runtime,logflare,vector
supabase start --workdir ./turborepo/packages/supabase -x storage-api,imgproxy,studio,edge-runtime,logflare,vector
shell: /usr/bin/bash -e {0}
Using workdir ./turborepo/packages/supabase
Starting database...
15.1.1.78: Pulling from supabase/postgres
9ea8908f4765: Pulling fs layer
[3](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:3)4942d66f6d0: Pulling fs layer
8fe03c8cf677: Pulling fs layer
76955[4](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:4)8ee90d: Pulling fs layer
8ace2fba2c0e: Pulling fs layer
afcea6ae84d0: Pulling fs layer
3362200394[5](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:5)1: Pulling fs layer
3d2e70a331b0: Pulling fs layer
553f2ee901[6](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:6)9: Pulling fs layer
db193fada6d[7](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:7): Pulling fs layer
bbb6bdacb9f4: Pulling fs layer
eb[8](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:8)e3a62ebc3: Pulling fs layer
97857d2f94d0: Pulling fs layer
1cf0d307bd7[9](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:9): Pulling fs layer
2d6ccbddec53: Pulling fs layer
9d87169e7894: Pulling fs layer
d6ce66d91aae: Pulling fs layer
a8f52234a996: Pulling fs layer
a2f86ca3c1f5: Pulling fs layer
2ae2b55e3df3: Pulling fs layer
39558f442d24: Pulling fs layer
d0ce73764c98: Pulling fs layer
5046425d6ca7: Pulling fs layer
0ba94043a671: Pulling fs layer
db193fada6d7: Waiting
bbb6bdacb9f4: Waiting
eb8e3a62ebc3: Waiting
97857d2f94d0: Waiting
1cf0d307bd79: Waiting
2d6ccbddec53: Waiting
9d87169e7894: Waiting
d6ce66d91aae: Waiting
a8f52234a996: Waiting
a2f86ca3c1f5: Waiting
2ae2b55e3df3: Waiting
39558f442d24: Waiting
d0ce73764c98: Waiting
5046425d6ca7: Waiting
0ba94043a671: Waiting
afcea6ae84d0: Waiting
336220039451: Waiting
3d2e70a331b0: Waiting
553f2ee90169: Waiting
7695548ee90d: Waiting
8ace2fba2c0e: Waiting
9ea8908f4765: Verifying Checksum
9ea8908f4765: Download complete
7695548ee90d: Verifying Checksum
7695548ee90d: Download complete
9ea8908f4765: Pull complete
34942d66f6d0: Verifying Checksum
34942d66f6d0: Download complete
34942d66f6d0: Pull complete
8ace2fba2c0e: Verifying Checksum
8ace2fba2c0e: Download complete
afcea6ae84d0: Verifying Checksum
afcea6ae84d0: Download complete
8fe03c8cf677: Verifying Checksum
8fe03c8cf677: Download complete
3d2e70a331b0: Verifying Checksum
3d2e70a331b0: Download complete
553f2ee90169: Verifying Checksum
553f2ee90169: Download complete
db193fada6d7: Verifying Checksum
db193fada6d7: Download complete
bbb6bdacb9f4: Verifying Checksum
bbb6bdacb9f4: Download complete
eb8e3a62ebc3: Verifying Checksum
eb8e3a62ebc3: Download complete
97857d2f94d0: Verifying Checksum
97857d2f94d0: Download complete
1cf0d307bd79: Verifying Checksum
1cf0d307bd79: Download complete
2d6ccbddec53: Verifying Checksum
2d6ccbddec53: Download complete
d6ce66d91aae: Verifying Checksum
d6ce66d91aae: Download complete
9d87169e7894: Verifying Checksum
9d87169e7894: Download complete
a8f52234a996: Verifying Checksum
a8f52234a996: Download complete
a2f86ca3c1f5: Verifying Checksum
a2f86ca3c1f5: Download complete
2ae2b55e3df3: Verifying Checksum
2ae2b55e3df3: Download complete
39558f442d24: Verifying Checksum
39558f442d24: Download complete
8fe03c8cf677: Pull complete
7695548ee90d: Pull complete
d0ce73764c98: Verifying Checksum
d0ce73764c98: Download complete
8ace2fba2c0e: Pull complete
5046425d6ca7: Verifying Checksum
5046425d6ca7: Download complete
0ba94043a671: Verifying Checksum
0ba94043a671: Download complete
afcea6ae84d0: Pull complete
336220039451: Verifying Checksum
336220039451: Download complete
336220039451: Pull complete
3d2e70a331b0: Pull complete
553f2ee90169: Pull complete
db193fada6d7: Pull complete
bbb6bdacb9f4: Pull complete
eb8e3a62ebc3: Pull complete
97857d2f94d0: Pull complete
1cf0d307bd79: Pull complete
2d6ccbddec53: Pull complete
9d87169e7894: Pull complete
d6ce66d91aae: Pull complete
a8f52234a996: Pull complete
a2f86ca3c1f5: Pull complete
2ae2b55e3df3: Pull complete
39558f442d24: Pull complete
d0ce73764c98: Pull complete
5046425d6ca7: Pull complete
0ba94043a671: Pull complete
Digest: sha256:881ac26a02870c6784d9fbec67a6a9c5026905216bbd7dfbfa289ecc48073387
Status: Downloaded newer image for ghcr.io/supabase/postgres:15.1.1.78
Setting up initial schema...
v2.30.34: Pulling from supabase/realtime
09f376ebb190: Pulling fs layer
68b794319434: Pulling fs layer
73f8237dcd61: Pulling fs layer
46a75fee84db: Pulling fs layer
ab199435ca35: Pulling fs layer
ec2eaff1d254: Pulling fs layer
609cf02e987f: Pulling fs layer
4f4fb700ef54: Pulling fs layer
46a75fee84db: Waiting
ab199435ca35: Waiting
ec2eaff1d254: Waiting
609cf02e987f: Waiting
4f4fb700ef54: Waiting
73f8237dcd61: Download complete
46a75fee84db: Verifying Checksum
46a75fee84db: Download complete
68b794319434: Download complete
ab199435ca35: Verifying Checksum
ab199435ca35: Download complete
09f376ebb190: Verifying Checksum
09f376ebb190: Download complete
4f4fb700ef54: Verifying Checksum
4f4fb700ef54: Download complete
609cf02e987f: Verifying Checksum
609cf02e987f: Download complete
ec2eaff1d254: Verifying Checksum
ec2eaff1d254: Download complete
09f376ebb190: Pull complete
68b794319434: Pull complete
73f8237dcd61: Pull complete
46a75fee84db: Pull complete
ab199435ca35: Pull complete
ec2eaff1d254: Pull complete
609cf02e987f: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:f43c080c74915340687727a34b21ae9cacc5ac21380d05b61efebeca6fd7ca4f
Status: Downloaded newer image for ghcr.io/supabase/realtime:v2.30.34
v1.11.13: Pulling from supabase/storage-api
43c4264eed91: Already exists
65e1b46b2b03: Pulling fs layer
9b2c43f8e8e6: Pulling fs layer
4daa6557aeb9: Pulling fs layer
952a3a2c3beb: Pulling fs layer
b7adc25d6652: Pulling fs layer
352786262d11: Pulling fs layer
d8d26525eb25: Pulling fs layer
2d7a0ed4639e: Pulling fs layer
2ed3ba55172c: Pulling fs layer
352786262d11: Waiting
d8d26525eb25: Waiting
2d7a0ed4639e: Waiting
2ed3ba55172c: Waiting
952a3a2c3beb: Waiting
b7adc25d6652: Waiting
9b2c43f8e8e6: Verifying Checksum
9b2c43f8e8e6: Download complete
4daa6557aeb9: Download complete
b7adc25d6652: Verifying Checksum
b7adc25d6652: Download complete
352786262d11: Download complete
d8d26525eb25: Verifying Checksum
d8d26525eb25: Download complete
65e1b46b2b03: Verifying Checksum
65e1b46b2b03: Download complete
2ed3ba55172c: Verifying Checksum
2ed3ba55172c: Download complete
2d7a0ed4639e: Verifying Checksum
2d7a0ed4639e: Download complete
65e1b46b2b03: Pull complete
9b2c43f8e8e6: Pull complete
4daa6557aeb9: Pull complete
952a3a2c3beb: Verifying Checksum
952a3a2c3beb: Download complete
952a3a2c3beb: Pull complete
b7adc25d6652: Pull complete
352786262d11: Pull complete
d8d26525eb25: Pull complete
2d7a0ed4639e: Pull complete
2ed3ba55172c: Pull complete
Digest: sha256:1e85dad48e8b3e85890a555e5114dc7ee48c2e8be4cfd97dd4e3564b4f[10](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:10)4fcd
Status: Downloaded newer image for ghcr.io/supabase/storage-api:v1.[11](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:11).13
v2.158.1: Pulling from supabase/gotrue
c6a83fedfae6: Pulling fs layer
de242506feb5: Pulling fs layer
bf04b0604f8d: Pulling fs layer
d0a2358fff01: Pulling fs layer
290ca41733e8: Pulling fs layer
13139648bbc4: Pulling fs layer
d0a2358fff01: Waiting
290ca41733e8: Waiting
13139648bbc4: Waiting
c6a83fedfae6: Verifying Checksum
c6a83fedfae6: Download complete
de242506feb5: Verifying Checksum
de242506feb5: Download complete
bf04b0604f8d: Verifying Checksum
bf04b0604f8d: Download complete
c6a83fedfae6: Pull complete
de242506feb5: Pull complete
bf04b0604f8d: Pull complete
290ca41733e8: Verifying Checksum
290ca41733e8: Download complete
13139648bbc4: Verifying Checksum
13139648bbc4: Download complete
d0a2358fff01: Verifying Checksum
d0a2358fff01: Download complete
d0a2358fff01: Pull complete
290ca41733e8: Pull complete
13139648bbc4: Pull complete
Digest: sha256:202c16530f2f29c886de963ab18b369074c49655480a463ce881169019f2bda7
Status: Downloaded newer image for ghcr.io/supabase/gotrue:v2.158.1
Seeding globals from roles.sql...
Applying migration 202402210[12](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:12)244_init.sql...
...
Seeding data from supabase/seed.sql...
Starting containers...
2.8.1: Pulling from supabase/kong
213ec9aee27d: Pulling fs layer
a70653f7a2d5: Pulling fs layer
531e3bd93090: Pulling fs layer
8[14](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:14)dd06d26c7: Pulling fs layer
814dd06d26c7: Waiting
a70653f7a2d5: Verifying Checksum
a70653f7a2d5: Download complete
213ec9aee27d: Verifying Checksum
213ec9aee27d: Download complete
213ec9aee27d: Pull complete
a70653f7a2d5: Pull complete
814dd06d26c7: Verifying Checksum
814dd06d26c7: Download complete
531e3bd93090: Verifying Checksum
531e3bd93090: Download complete
531e3bd93090: Pull complete
814dd06d26c7: Pull complete
Digest: sha256:1b53405d8680a09d6f44494b7990bf7da2ea43f84a258c59717d4539abf09f6d
Status: Downloaded newer image for ghcr.io/supabase/kong:2.8.1
3.0.3: Pulling from supabase/inbucket
530afca65e2e: Pulling fs layer
866f56904284: Pulling fs layer
e356c9130232: Pulling fs layer
8d4341af276d: Pulling fs layer
82a73217a072: Pulling fs layer
64b833ffe729: Pulling fs layer
a77af8706e66: Pulling fs layer
9c842edb6049: Pulling fs layer
8d4341af276d: Waiting
82a73217a072: Waiting
64b833ffe729: Waiting
a77af8706e66: Waiting
9c842edb6049: Waiting
e356c9130232: Verifying Checksum
e356c9130232: Download complete
866f56904284: Download complete
530afca65e2e: Verifying Checksum
530afca65e2e: Download complete
530afca65e2e: Pull complete
866f56904284: Pull complete
e356c9130232: Pull complete
8d4341af276d: Verifying Checksum
8d4341af276d: Download complete
8d4341af276d: Pull complete
64b833ffe729: Verifying Checksum
64b833ffe729: Download complete
82a73217a072: Verifying Checksum
82a73217a072: Download complete
82a73217a072: Pull complete
64b833ffe729: Pull complete
a77af8706e66: Verifying Checksum
a77af8706e66: Download complete
a77af8706e66: Pull complete
9c842edb6049: Download complete
9c842edb6049: Pull complete
Digest: sha256:dc912ab76de647ca2a363fe2855[15](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:15)e512e964cf699166773f3c2c73f5e7f71c0
Status: Downloaded newer image for ghcr.io/supabase/inbucket:3.0.3
v12.2.0: Pulling from supabase/postgrest
108bc7be5b68: Pulling fs layer
108bc7be5b68: Verifying Checksum
108bc7be5b68: Download complete
108bc7be5b68: Pull complete
Digest: sha256:2cf1efd2c9c2e7606610c113cc73e936d8ce9ba089271cb9cbf11aa564bc30c7
Status: Downloaded newer image for ghcr.io/supabase/postgrest:v12.2.0
v0.83.2: Pulling from supabase/postgres-meta
f11c1adaa26e: Pulling fs layer
a9776ac865ab: Pulling fs layer
b39915[17](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:17)f32a: Pulling fs layer
fbb2cb26f3c3: Pulling fs layer
1bb310aa4760: Pulling fs layer
fb06fc0c10e3: Pulling fs layer
03a310bfc02a: Pulling fs layer
920247f40b56: Pulling fs layer
b7a4d4ebe998: Pulling fs layer
0ea9cd394ab2: Pulling fs layer
fb06fc0c10e3: Waiting
fbb2cb26f3c3: Waiting
1bb310aa4760: Waiting
920247f40b56: Waiting
b7a4d4ebe998: Waiting
0ea9cd394ab2: Waiting
03a310bfc02a: Waiting
a9776ac865ab: Verifying Checksum
a9776ac865ab: Download complete
fbb2cb26f3c3: Verifying Checksum
fbb2cb26f3c3: Download complete
1bb310aa4760: Verifying Checksum
1bb310aa4760: Download complete
f11c1adaa26e: Verifying Checksum
f11c1adaa26e: Download complete
03a310bfc02a: Verifying Checksum
03a310bfc02a: Download complete
b39915[17](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:18)f32a: Verifying Checksum
b3991517f32a: Download complete
fb06fc0c10e3: Verifying Checksum
fb06fc0c10e3: Download complete
b7a4d4ebe998: Verifying Checksum
b7a4d4ebe998: Download complete
0ea9cd394ab2: Verifying Checksum
0ea9cd394ab2: Download complete
f11c1adaa26e: Pull complete
a9776ac865ab: Pull complete
9[20](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:21)247f40b56: Verifying Checksum
920247f40b56: Download complete
b3991517f32a: Pull complete
fbb2cb26f3c3: Pull complete
1bb310aa4760: Pull complete
fb06fc0c10e3: Pull complete
03a310bfc02a: Pull complete
920247f40b56: Pull complete
b7a4d4ebe998: Pull complete
0ea9cd394ab2: Pull complete
Digest: sha256:0e8cf91a277aefb7f85e4ec01c3b0ae69882b351c7927e3e[21](https://github.com/foundrydev/foundry/actions/runs/11342441101/job/31542851043#step:14:22)ce59c151ae780c
Status: Downloaded newer image for ghcr.io/supabase/postgres-meta:v0.83.2
Waiting for health checks...
The only way to exclude storage and realtime images from downloading is to disable those services in config.toml.
[storage]
enabled = false
[realtime]
enabled = false
Appreciate the quick response @sweatybridge , I guess the confusing bit is that the cli states it can be excluded?
supabase start --help
Start containers for Supabase local development
Usage:
supabase start [flags]
Flags:
-x, --exclude strings Names of containers to not start. [gotrue,realtime,storage-api,imgproxy,kong,inbucket,postgrest,postgres-meta,studio,edge-runtime,logflare,vector,supavisor]
The auth, storage, and realtime images are special because they contain schema migrations to initialize the database.
If you exclude any of them via -x flag, those containers will not be started, but we still need to download the images to migrate the local database. So the help text of the exclude flag is technically true, but I can see why it might be confusing from what you'd expect.
Disabling those services in config.toml is the only way to skip applying schema migrations from those services. Since their migrations are skipped, we don't need to download the docker images for those services.