Skip to content
Discussion options

You must be logged in to vote

Two things going wrong at once — both point at how Docker layering interacts with bunx caching.

Why your BUN_INSTALL_CACHE_DIR setup silently does nothing

ENTRYPOINT ["/bin/sh", "-c", "BUN_INSTALL_CACHE_DIR=$WORKSPACE_FOLDER/.bun/install/cache && bunx xxx"]

There are three problems stacked here:

  1. The && makes the assignment temporary and not exported. Writing X=Y && bunx … assigns X in the shell and then runs bunx as a child process that does not inherit X. You want either X=Y bunx … (single command line, X is exported just for that child) or export X=Y; bunx ….
  2. $WORKSPACE_FOLDER is expanded at container-start time, not at build time. That's fine, but combined with (1) it's just dead text.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by seepine
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants