Skip to content

fix: make the in-container path the same as host path #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/Node/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ NODE_DOCKER_IMAGE=node:${NODE_VERSION}-alpine
endif

ifndef NODE_DOCKER_COMMAND
NODE_DOCKER_COMMAND=docker run --init --interactive ${DOCKER_TTY} --rm ${DOCKER_ENV} ${DOCKER_USER} --volume "$(DOCKER_CWD):/project" --volume "${HOME}/.npm:/home/node/.npm" --workdir /project ${NODE_DOCKER_IMAGE}
NODE_DOCKER_COMMAND=docker run --init --interactive ${DOCKER_TTY} --rm ${DOCKER_ENV} ${DOCKER_USER} --volume "$(DOCKER_CWD):$(DOCKER_CWD)" --volume "${HOME}/.npm:/home/node/.npm" --workdir "$(DOCKER_CWD)" ${NODE_DOCKER_IMAGE}
endif

sh/node: | ${HOME}/.npm ## Run Node shell
Expand Down
2 changes: 1 addition & 1 deletion resources/PHP/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PHPQA_DOCKER_IMAGE=jakzal/phpqa:1.102.0-php${PHP_VERSION}-alpine
endif

ifndef PHPQA_DOCKER_COMMAND
PHPQA_DOCKER_COMMAND=docker run --init --interactive ${DOCKER_TTY} --rm ${DOCKER_ENV} --env "COMPOSER_CACHE_DIR=/composer/cache" ${DOCKER_USER} --volume "$(DOCKER_CWD)/var/phpqa:/cache" --volume "$(DOCKER_CWD):/project" --volume "${HOME}/.composer:/composer" --workdir /project ${PHPQA_DOCKER_IMAGE}
PHPQA_DOCKER_COMMAND=docker run --init --interactive ${DOCKER_TTY} --rm ${DOCKER_ENV} --env "COMPOSER_CACHE_DIR=/composer/cache" ${DOCKER_USER} --volume "$(DOCKER_CWD)/var/phpqa:/cache" --volume "$(DOCKER_CWD):$(DOCKER_CWD)" --volume "${HOME}/.composer:/composer" --workdir "$(DOCKER_CWD)" ${PHPQA_DOCKER_IMAGE}
endif

sh/php: | ${HOME}/.composer var/phpqa composer.lock ## Run PHP shell
Expand Down
2 changes: 1 addition & 1 deletion resources/YASSG/compat.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LYCHEE_DOCKER_IMAGE=lycheeverse/lychee:0.13.0
endif

ifndef LYCHEE_DOCKER_COMMAND
LYCHEE_DOCKER_COMMAND=docker run --init --interactive ${DOCKER_TTY} --rm ${DOCKER_USER} --volume "$(DOCKER_CWD):/project:ro" --workdir /project ${LYCHEE_DOCKER_IMAGE}
LYCHEE_DOCKER_COMMAND=docker run --init --interactive ${DOCKER_TTY} --rm ${DOCKER_USER} --volume "$(DOCKER_CWD):$(DOCKER_CWD):ro" --workdir "$(DOCKER_CWD)" ${LYCHEE_DOCKER_IMAGE}
endif

dist: composer/normalize cs analyze/phpstan analyze/psalm test ## Prepare the codebase for commit
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/Node/CommonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function getExpectedInitPaths(): array
private static function generateNodeExecutionPath(string $command, string $nodeVersion, string $dockerImage, string $env): string
{
return self::normalize(\sprintf(
'docker run --init --interactive --rm %4$s%2$s --volume "$ROOT:/project" --volume "$HOME/.npm:/home/node/.npm" --workdir /project %3$s %1$s',
'docker run --init --interactive --rm %4$s%2$s --volume "$ROOT:$ROOT" --volume "$HOME/.npm:/home/node/.npm" --workdir "$ROOT" %3$s %1$s',
\sprintf($command, $nodeVersion),
self::generateDockerComposeExecutionUser(),
\sprintf($dockerImage, $nodeVersion),
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/PHP/PhpTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private static function paths(?array $env): array
private static function generatePhpqaExecutionPath(string $command, string $phpVersion, string $dockerImage, string $env): string
{
return self::normalize(\sprintf(
'docker run --init --interactive --rm %4$s--env "COMPOSER_CACHE_DIR=/composer/cache" %2$s --volume "$ROOT/var/phpqa:/cache" --volume "$ROOT:/project" --volume "$HOME/.composer:/composer" --workdir /project %3$s %1$s',
'docker run --init --interactive --rm %4$s--env "COMPOSER_CACHE_DIR=/composer/cache" %2$s --volume "$ROOT/var/phpqa:/cache" --volume "$ROOT:$ROOT" --volume "$HOME/.composer:/composer" --workdir "$ROOT" %3$s %1$s',
\sprintf($command, $phpVersion),
self::generateDockerComposeExecutionUser(),
\sprintf($dockerImage, $phpVersion),
Expand Down