Skip to content

Commit

Permalink
Improve docker backend building
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSimpson committed Feb 6, 2018
1 parent baeb037 commit 9ef2946
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Builder/scripts/docker-builder-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ docker ${DEBUG_FLAG} run -d -p 5000:5000 --restart=always --name registry regist

# Build the Dockerfile docker image in the current directory
mv ./container.def Dockerfile
docker ${DEBUG_FLAG} build -t localhost:5000/docker_image:latest . || { echo 'Build Failed' ; exit 1; }
/usr/bin/unbuffer /usr/bin/docker ${DEBUG_FLAG} build -t localhost:5000/docker_image:latest . || { echo 'Build Failed' ; exit 1; }

# Push to the local registry
docker ${DEBUG_FLAG} push localhost:5000/docker_image:latest
/usr/bin/unbuffer /usr/bin/docker ${DEBUG_FLAG} push localhost:5000/docker_image:latest

# Build the singularity container from the docker image
export SINGULARITY_CACHEDIR=/home/builder/.singularity
export SINGULARITY_NOHTTPS=true
export SINGULARITY_PULLFOLDER=/home/builder
singularity ${DEBUG_FLAG} pull --name container.simg docker://localhost:5000/docker_image:latest
/usr/bin/unbuffer /usr/bin/singularity ${DEBUG_FLAG} pull --name container.simg docker://localhost:5000/docker_image:latest

# Workaround for PULLFOLDER not being respected: https://github.com/singularityware/singularity/pull/855
if [ -e ${SINGULARITY_CACHEDIR}/container.simg ] ; then
Expand Down
1 change: 1 addition & 0 deletions Client/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ int main(int argc, char *argv[]) {
// Read container from builder
read_file(builder_stream, client_data.container_path);

Logger::info("Images created at " + client_data.container_path);
} catch (const boost::exception &ex) {
auto diagnostics = diagnostic_information(ex);
Logger::error(std::string() + "Container Builder exception encountered: " + diagnostics);
Expand Down

0 comments on commit 9ef2946

Please sign in to comment.