diff --git a/build.sh b/build.sh index 4627ffddf6..937490d9af 100755 --- a/build.sh +++ b/build.sh @@ -18,6 +18,7 @@ function nixify() { exec nix develop \ --ignore-environment \ --keep HOME \ + --keep DOCKER_HOST \ --keep CI_BRANCH \ --keep CI_COMMIT \ --keep CI_BRANCH_TAG \ diff --git a/devops/.env.sh b/devops/.env.sh index 4f05f963a2..d03f2cc474 100755 --- a/devops/.env.sh +++ b/devops/.env.sh @@ -3,7 +3,6 @@ set -e set -x -export _JAVA_OPTIONS="-Xmx4000M -XX:ReservedCodeCacheSize=384M -XX:NonProfiledCodeHeapSize=256M -XX:MaxMetaspaceSize=1024M" export SCALA212=$(cat project/Deps.sc | grep 'val scala212 ' | sed -r 's/.*\"(.*)\".**/\1/') export SCALA213=$(cat project/Deps.sc | grep 'val scala213 ' | sed -r 's/.*\"(.*)\".**/\1/') @@ -25,3 +24,19 @@ export VERSION_COMMAND="++ $SCALA_VERSION" JDK_VERSION_VAR="JDK${JAVA_VERSION}" export JAVA_HOME="${!JDK_VERSION_VAR}" export PATH=$JAVA_HOME/bin:$PATH + + +export _JAVA_OPTIONS=" + # JVM ignores HOME and relies on getpwuid to determine home directory + # That fails when we run self-hosted github agent under non-dynamic user + # We need that for rootless docker to work + -Duser.home=${HOME} + -Xmx4000M + -XX:ReservedCodeCacheSize=384M + -XX:NonProfiledCodeHeapSize=256M + -XX:MaxMetaspaceSize=1024M +" + +_JAVA_OPTIONS="$(echo ${_JAVA_OPTIONS} | grep -v '#' | tr '\n' ' ' | tr -s ' ')" + +env \ No newline at end of file diff --git a/devops/coverage.sh b/devops/coverage.sh index 3b61479739..e2e47d1eab 100755 --- a/devops/coverage.sh +++ b/devops/coverage.sh @@ -4,7 +4,6 @@ set -e set -x source ./devops/.env.sh -printenv sbt -batch -no-colors -v \ "$VERSION_COMMAND clean" \ diff --git a/devops/gen-js.sh b/devops/gen-js.sh index 50d3f35ab3..4db4d823a8 100755 --- a/devops/gen-js.sh +++ b/devops/gen-js.sh @@ -3,4 +3,6 @@ set -e set -x +source ./devops/.env.sh + bash sbtgen.sc --js \ No newline at end of file diff --git a/devops/gen-jsonly.sh b/devops/gen-jsonly.sh index 4d3f2f46bc..7bfd7e2118 100755 --- a/devops/gen-jsonly.sh +++ b/devops/gen-jsonly.sh @@ -3,4 +3,6 @@ set -e set -x +source ./devops/.env.sh + bash sbtgen.sc --nojvm --js \ No newline at end of file diff --git a/devops/gen.sh b/devops/gen.sh index cfe2c10f88..7ce89e4de6 100755 --- a/devops/gen.sh +++ b/devops/gen.sh @@ -3,4 +3,6 @@ set -e set -x +source ./devops/.env.sh + bash sbtgen.sc \ No newline at end of file diff --git a/devops/publish-scala.sh b/devops/publish-scala.sh index 17f58022f1..3f7fdd0180 100755 --- a/devops/publish-scala.sh +++ b/devops/publish-scala.sh @@ -4,8 +4,6 @@ set -e set -x source ./devops/.env.sh -printenv - source ./devops/.validate-publishing.sh [[ ! -f "$SONATYPE_SECRET" ]] && echo "SONATYPE_SECRET=$SONATYPE_SECRET is not a file" && exit 0 diff --git a/devops/site-publish.sh b/devops/site-publish.sh index a087d19b9c..d7d9405c56 100755 --- a/devops/site-publish.sh +++ b/devops/site-publish.sh @@ -4,8 +4,6 @@ set -e set -x source ./devops/.env.sh -printenv - source ./devops/.validate-publishing.sh sbt -batch -no-colors -v \ diff --git a/devops/site-test.sh b/devops/site-test.sh index 0233a8be81..d9009f2e73 100755 --- a/devops/site-test.sh +++ b/devops/site-test.sh @@ -4,7 +4,6 @@ set -e set -x source ./devops/.env.sh -printenv sbt -batch -no-colors -v \ "project docs" \ diff --git a/devops/test.sh b/devops/test.sh index 803ec00737..8fd9f255ca 100755 --- a/devops/test.sh +++ b/devops/test.sh @@ -4,7 +4,6 @@ set -e set -x source ./devops/.env.sh -printenv sbt -batch -no-colors -v \ "$VERSION_COMMAND clean" \ diff --git a/distage/distage-framework-docker/src/main/scala/izumi/distage/docker/modules/DockerSupportModule.scala b/distage/distage-framework-docker/src/main/scala/izumi/distage/docker/modules/DockerSupportModule.scala index 0133a07aeb..a403daaf96 100644 --- a/distage/distage-framework-docker/src/main/scala/izumi/distage/docker/modules/DockerSupportModule.scala +++ b/distage/distage-framework-docker/src/main/scala/izumi/distage/docker/modules/DockerSupportModule.scala @@ -19,9 +19,17 @@ class DockerSupportModule[F[_]: TagK](configModule: ModuleBase) extends ModuleDe make[DefaultDockerClientConfig].from { (clientConfig: Docker.ClientConfig) => /** We do not need to use global registry here since it would be overridden in CMD requests. */ - val remote = clientConfig.remote.filter(_ => clientConfig.useRemote) + val remote = clientConfig.remote + .filter(_ => clientConfig.useRemote) Value(DefaultDockerClientConfig.createDefaultConfigBuilder()) - .mut(remote)((b, c) => b.withDockerHost(c.host).withDockerTlsVerify(c.tlsVerify).withDockerCertPath(c.certPath).withDockerConfig(c.config)) + .mut(remote)( + (builder, remoteConfig) => + builder + .withDockerHost(remoteConfig.host) + .withDockerTlsVerify(remoteConfig.tlsVerify) + .withDockerCertPath(remoteConfig.certPath) + .withDockerConfig(remoteConfig.config) + ) .get.build() }