0

I have a complex conda environment that I would like to copy into a container on build. The conda environment pre-exists and is outside the build directory hierarchy. This is the Dockerfile I am using:

FROM code.ornl.gov:4567/olcfcontainers/olcfbaseimages/mpiimage-centos-cuda

RUN mkdir /app

# conda is local symlink to conda env hierarchy outside the current working directory
COPY conda/ /app
RUN cd /app && conda activate /app/conda

I get the following error when building with podman:

STEP 6: COPY conda /app
Error: error building at STEP "COPY conda /app": error adding sources [/gpfs/alpine/bif135/scratch/mcoletti/deepmd_on_Summit/conda]: error reading "/gpfs/alpine/bif135/scratch/mcoletti/deepmd_on_Summit/conda": error during bulk transfer for copier.request{Request:"GET", Root:"/", preservedRoot:"/gpfs/alpine/bif135/scratch/mcoletti/deepmd_on_Summit", rootPrefix:"/gpfs/alpine/bif135/scratch/mcoletti/deepmd_on_Summit", Directory:"/", preservedDirectory:"/gpfs/alpine/bif135/scratch/mcoletti/deepmd_on_Summit", Globs:[]string{"/conda"}, preservedGlobs:[]string{"/gpfs/alpine/bif135/scratch/mcoletti/deepmd_on_Summit/conda"}, StatOptions:copier.StatOptions{CheckForArchives:false, Excludes:[]string(nil)}, GetOptions:copier.GetOptions{UIDMap:[]idtools.IDMap(nil), GIDMap:[]idtools.IDMap(nil), Excludes:[]string(nil), ExpandArchives:false, ChownDirs:(*idtools.IDPair)(0xc0004a73d0), ChmodDirs:(*os.FileMode)(nil), ChownFiles:(*idtools.IDPair)(0xc0004a73e0), ChmodFiles:(*os.FileMode)(nil), StripSetuidBit:true, StripSetgidBit:true, StripStickyBit:false, StripXattrs:false, KeepDirectoryNames:false, Rename:map[string]string(nil)}, PutOptions:copier.PutOptions{UIDMap:[]idtools.IDMap(nil), GIDMap:[]idtools.IDMap(nil), DefaultDirOwner:(*idtools.IDPair)(nil), DefaultDirMode:(*os.FileMode)(nil), ChownDirs:(*idtools.IDPair)(nil), ChmodDirs:(*os.FileMode)(nil), ChownFiles:(*idtools.IDPair)(nil), ChmodFiles:(*os.FileMode)(nil), StripXattrs:false, IgnoreXattrErrors:false, IgnoreDevices:false, NoOverwriteDirNonDir:false, Rename:map[string]string(nil)}, MkdirOptions:copier.MkdirOptions{UIDMap:[]idtools.IDMap(nil), GIDMap:[]idtools.IDMap(nil), ChownNew:(*idtools.IDPair)(nil), ChmodNew:(*os.FileMode)(nil)}}: copier: get: lstat "/conda"("/gpfs/alpine/proj-shared/chm174/conda"): lstat /gpfs/alpine/proj-shared/chm174/conda: no such file or directory

And, yes, that path actually exists.

Be warned that this is on the Oak Ridge National Laboratory's Summit Supercomputer, so there may also be some local weirdness.

Mark Coletti
  • 195
  • 11
  • 1
    `lstat /gpfs/alpine/proj-shared/chm174/conda` - you cannot link files from outside the build context – JeffRSon Oct 10 '22 at 16:27

1 Answers1

0

The answer was gleaned from this comment. Since all I wanted to do was to copy in the conda env, I could set the build context in the directory that contained the conda environment while specifying the Dockerfile, which was in a different directory altogether.

So:

podman build -f Dockerfile -t containertest:latest /path/to/conda/dir/ ;

Mark Coletti
  • 195
  • 11