Skip to content

Commit 61cfa97

Browse files
cderinbogazclaude
andauthored
Fix macOS extended attributes error in Docker container operations (#19)
Improve tar commands to properly exclude extended attributes on macOS that cause "lsetxattr com.apple.provenance" errors in Docker operations. This extends the previous fix to cover additional tar operations in the container setup process. Changes: - Add explicit --no-xattrs and --no-fflags flags for macOS tar operations - Apply fix to both git history copying and Claude config directory copying - Auto-fix ESLint style issues for consistency 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 15c1b97 commit 61cfa97

File tree

2 files changed

+176
-170
lines changed

2 files changed

+176
-170
lines changed

src/container.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,11 @@ exec claude --dangerously-skip-permissions' > /start-claude.sh && \\
593593
// Exclude macOS resource fork files and .DS_Store when creating git archive
594594
// Also strip extended attributes to prevent macOS xattr issues in Docker
595595
const tarFlags = getTarFlags();
596+
// On macOS, also exclude extended attributes that cause Docker issues
597+
const additionalFlags = (process.platform as string) === "darwin" ? "--no-xattrs --no-fflags" : "";
598+
const combinedFlags = `${tarFlags} ${additionalFlags}`.trim();
596599
execSync(
597-
`tar -cf "${gitTarFile}" --exclude="._*" --exclude=".DS_Store" ${tarFlags} .git`,
600+
`tar -cf "${gitTarFile}" --exclude="._*" --exclude=".DS_Store" ${combinedFlags} .git`,
598601
{
599602
cwd: workDir,
600603
stdio: "pipe",
@@ -785,8 +788,11 @@ exec claude --dangerously-skip-permissions' > /start-claude.sh && \\
785788

786789
const tarFile = `/tmp/claude-dir-${Date.now()}.tar`;
787790
const tarFlags = getTarFlags();
791+
// On macOS, also exclude extended attributes that cause Docker issues
792+
const additionalFlags = (process.platform as string) === "darwin" ? "--no-xattrs --no-fflags" : "";
793+
const combinedFlags = `${tarFlags} ${additionalFlags}`.trim();
788794
execSync(
789-
`tar -cf "${tarFile}" ${tarFlags} -C "${os.homedir()}" .claude`,
795+
`tar -cf "${tarFile}" ${combinedFlags} -C "${os.homedir()}" .claude`,
790796
{
791797
stdio: "pipe",
792798
},

0 commit comments

Comments
 (0)