Skip to content

Commit

Permalink
JPERF-1457 Fix docker in docker
Browse files Browse the repository at this point in the history
Failing after docker changed how it uses 'ulimit' command, adding 'H' param treaded as invalid
  • Loading branch information
mgrzaslewicz committed Feb 8, 2024
1 parent 3058505 commit 75f328a
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ internal class Docker {
* Sometimes it's already running. We don't want stderr spam in that case.
*/
private fun startDockerIfNecessary(ssh: SshConnection) {
dockerUlimitWorkaround(ssh)
ssh.execute("sudo service docker status || sudo service docker start")
IdempotentAction("Check if Docker is running") {
ssh.execute(
Expand All @@ -84,4 +85,13 @@ internal class Docker {
backoff = StaticBackoff(Duration.ofMillis(500))
)
}

/**
* Docker added 'H' parameter to ulimit which makes it an invalid command.
* Problem showed up with docker-ce 25.0.0
* https://forums.docker.com/t/etc-init-d-docker-62-ulimit-error-setting-limit-invalid-argument-problem/139424
*/
private fun dockerUlimitWorkaround(ssh: SshConnection) {
ssh.execute("sudo sed -i 's/ulimit -Hn/ulimit -n/' /etc/init.d/docker")
}
}

0 comments on commit 75f328a

Please sign in to comment.