Skip to content

Commit

Permalink
daemon socket root
Browse files Browse the repository at this point in the history
  • Loading branch information
BarDweller committed Apr 30, 2024
1 parent 0cb0c1a commit 0889f7d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ public ContainerStatus runPhase(dev.snowdrop.buildpack.Logger logger, boolean us
args.addArg("-launch-cache", LifecyclePhaseFactory.LAUNCH_CACHE_VOL_PATH);
}

//if using daemon, add daemon arg
int runAsId = factory.getBuilderImage().getUserId();

//if using daemon, add daemon arg, run as root
if(factory.getDockerConfig().getUseDaemon()){
args.addArg("-daemon");
args.addArg("-daemon");
runAsId = 0;
}


int runAsId = factory.getBuilderImage().getUserId();
String id = factory.getContainerForPhase(args.toArray(), runAsId);
try{
log.info("- analyze container id " + id+ " will be run with uid "+runAsId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ public ContainerStatus runPhase(dev.snowdrop.buildpack.Logger logger, boolean us
args.addArg("-run", "/cnb/run.toml");
}

//if using daemon, add daemon arg
int runAsId = factory.getBuilderImage().getUserId();

//if using daemon, add daemon arg, run as root
if(factory.getDockerConfig().getUseDaemon()){
args.addArg("-daemon");
runAsId = 0;
}

int runAsId = factory.getBuilderImage().getUserId();

String id = factory.getContainerForPhase(args.toArray(), runAsId);
try{
log.info("- export container id " + id+ " will be run with uid "+runAsId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ public ContainerStatus runPhase(dev.snowdrop.buildpack.Logger logger, boolean us
args.addArg("-build-image", originalBuilder.getImage().getReference());
}

int runAsId = factory.getBuilderImage().getUserId();

if(factory.getPlatformLevel().atLeast("0.12") && factory.getDockerConfig().getUseDaemon()){
args.addArg("-daemon");
runAsId = 0;
}

int runAsId = factory.getBuilderImage().getUserId();

String id = factory.getContainerForPhase(args.toArray(), runAsId);
try{
log.info("- restorer container id " + id+ " will be run with uid "+runAsId+" and args "+args);
Expand Down

0 comments on commit 0889f7d

Please sign in to comment.