简体   繁体   中英

Substitute for docker-compose using singularity linux

Thanks for viewing my question!

Problem: I'm fairly new to docker and linux. I am wanting to run a docker image in my linux dist (CentOS version 7), where I don't have the ability to change the root. Singularity v.3.6.4 is installed, and I pull the docker image using:

module load singularity/3.6.4
singularity pull docker://usdaarsnwrc/awsm:0.10

Note that, because I can't change the root, I have set the SINGULARITY_TMPDIR and SINGULARITY_CACHEDIR to my home directory.

This works without error.

I then download a test case:

git clone https://github.com/USDA-ARS-NWRC/awsm_test_cases.git

And try to run it using their suggested command:

python ./awsm_docker --case tuol

I get the following error:

/bin/sh: docker-compose: command not found
Traceback (most recent call last):
File "./awsm_docker", line 73, in <module>
     run()
File "./awsm_docker", line 55, in run
os.remove('./{}/topo/maxus.nc'.format(fpc))
FileNotFoundError: [Errno 2] No such file or directory: './tuolumne/topo/maxus.nc'

Question
It seems like this error results from the script, awsm_docker contained in the test data folder, which calls docker-compose in two instances. Ex:

    run_call = ('docker-compose'
                ' -f ./{}/docker-compose.yml'
                ' run awsm /data/input/{}').format(fpc, cfg)
    call(run_call, shell=True, universal_newlines=True)

So it seems like my issue is translating docker-compose to language that's compatible with singularity? Any ideas on how this would work?

Thank you for your help!

Though both are containers, Singularity can't always be used as a drop in replacement for Docker. When docker-compose is involved, you're always going to have to do some extra work.

In this case, since docker-compose is being called directly in their python script, you're going to have to write an equivalent script with the equivalent singularity commands. They are nice enough to print out the full docker command you need to modify. Between that, the Docker documentation and the docs on singularity and docker , you should have what you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM