#!/bin/bash

export APPTAINER_BINDPATH=/afs,/cvmfs,/data/dust/user:/data/dust/user,/pnfs,/cvmfs/grid.cern.ch/etc/grid-security:/etc/grid-security,/cvmfs/grid.cern.ch/etc/grid-security/vomses:/etc/vomses,/etc/pki/ca-trust,/run/user,/tmp,/var/run/user,/etc/sysconfig,/etc:/orig/etc,/etc/krb5.conf:/etc/krb5.conf,/etc/krb5.conf.d:/etc/krb5.conf.d,/var/lib/sss/pubconf:/var/lib/sss/pubconf,/etc/krb5.keytab:/etc/krb5.keytab,/var/kerberos:/var/kerberos,/etc/crypto-policies/back-ends:/etc/crypto-policies/back-ends,/etc/condor-ce:/etc/condor-ce,/etc/condor:/etc/condor,/var/lib/condor:/var/lib/condor,/usr/bin/condor_docker_enter:/usr/bin/condor_docker_enter,/lib64/libcondor_utils_23_0_17.so:/lib64/libcondor_utils_23_0_17.so

apptainer -s exec --env PS1="$PS1" --no-home --bind /data,/cvmfs,/pnfs /cvmfs/unpacked.cern.ch/gitlab-registry.cern.ch/cms-cat/cmssw-lxplus/cmssw-el7-lxplus:latest/ sh -c "export _condor_schedd_host=bird-htc-sched21.desy.de && export _condor_schedd_name=bird-htc-sched21.desy.de && export _condor_condor_host=bird-htc-master21.desy.de && export _condor_credd_host=bird-htc-sched21.desy.de && export _condor_default_domain_name=desy.de && export _condor_uid_domain=desy.de && export _condor_filesystem_domain=desy.de && export _CondorPlatform=\"$CondorPlatform: x86_64_RedHat9 $\" && export _condor_sec_credential_producer=/var/lib/condor/util/get_token_cmd && /bin/bash -l"
