Skip to content
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

Remove undocumented userEmulation mode #4596

Merged
merged 1 commit into from
Dec 18, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@
*/

package nextflow.container


import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
/**
* Helper methods to handle Docker containers
*
* @author Paolo Di Tommaso <[email protected]>
*/
@Slf4j
@CompileStatic
class DockerBuilder extends ContainerBuilder<DockerBuilder> {

private boolean sudo

private boolean remove = true

private boolean userEmulation

private String registry

private String name

private boolean tty

private static final String USER_AND_HOME_EMULATION = '-u $(id -u) -e "HOME=${HOME}" -v /etc/passwd:/etc/passwd:ro -v /etc/shadow:/etc/shadow:ro -v /etc/group:/etc/group:ro -v $HOME:$HOME'

private String removeCommand

private String killCommand
Expand Down Expand Up @@ -69,8 +69,8 @@ class DockerBuilder extends ContainerBuilder<DockerBuilder> {
if( params.containsKey('runOptions') )
addRunOptions(params.runOptions.toString())

if ( params.containsKey('userEmulation') )
this.userEmulation = params.userEmulation?.toString() == 'true'
if ( params.userEmulation?.toString() == 'true' )
log.warn1("Undocumented setting `docker.userEmulation` is not supported any more - consider to remove it from your config")

if ( params.containsKey('remove') )
this.remove = params.remove?.toString() == 'true'
Expand Down Expand Up @@ -150,9 +150,6 @@ class DockerBuilder extends ContainerBuilder<DockerBuilder> {
if( temp )
result << "-v $temp:/tmp "

if( userEmulation )
result << USER_AND_HOME_EMULATION << ' '

// mount the input folders
result << makeVolumes(mounts)
result << '-w "$NXF_TASK_WORKDIR" '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ class DockerBuilderTest extends Specification {
.build()
.runCommand == 'docker run -i -v "$NXF_TASK_WORKDIR":"$NXF_TASK_WORKDIR" -w "$NXF_TASK_WORKDIR" -x --zeta busybox'

new DockerBuilder('busybox')
.params(userEmulation:true)
.build()
.runCommand == 'docker run -i -u $(id -u) -e "HOME=${HOME}" -v /etc/passwd:/etc/passwd:ro -v /etc/shadow:/etc/shadow:ro -v /etc/group:/etc/group:ro -v $HOME:$HOME -v "$NXF_TASK_WORKDIR":"$NXF_TASK_WORKDIR" -w "$NXF_TASK_WORKDIR" busybox'

new DockerBuilder('busybox')
.setName('hola')
.build()
Expand Down
Loading