Coder Social home page Coder Social logo

add a local folder? about ariac HOT 7 CLOSED

usnistgov avatar usnistgov commented on August 22, 2024
add a local folder?

from ariac.

Comments (7)

zeidk avatar zeidk commented on August 22, 2024

Not sure what you are trying to do with the local folder but for testing purposes you can look at how it is done in build_team_system.bash
Everything in build_team_system.bash is happening in the image, so mkdir ~/some_local_folder will actually create some_local_folder in your image.

from ariac.

dan9thsense avatar dan9thsense commented on August 22, 2024

What I want to do is copy a file or folder from my local drive into the image, rather than using wget or cloning a repository. That way I can test changes to the code without having to update the repo for every little change.

from ariac.

Pavel-P avatar Pavel-P commented on August 22, 2024

For local testing you can use docker cp (https://docs.docker.com/engine/reference/commandline/cp/).
This is run outside of the container though, so it won't work in build_team_system.bash

from ariac.

dan9thsense avatar dan9thsense commented on August 22, 2024

Hmmm, I was hoping there would be a way to integrate it into the build_team_system.bash or run_team_system.bash files, so it would work seamlessly. Seems odd that it can pull a repo but not pull from the local drive.

from ariac.

stevegray954 avatar stevegray954 commented on August 22, 2024

I'd like to second this request.

build_team_system.bash calls build_competitor_image.bash

@dan9thsense You'd have to copy your file/folder into the docker build context (the ariac-docker/ariac-competitor folder. The bash script already copies the build and run team system scripts there for this reason.

Inside the Dockerfile, why not copy the entire directory instead just those two files one at a time?

from ariac.

zeidk avatar zeidk commented on August 22, 2024

After some testing, I think I found a way to do just that but there is a caveat.

  1. You need to modify ariac-docker/ariac-competitor/ariac-competitor/Dockerfile
  2. Copy the following command in ariac-docker/ariac-competitor/ariac-competitor/Dockerfile to copy the directory ariac_ws (from your computer) to /home/ariac-user/ariac_ws (in your image): COPY ariac_ws /home/ariac-user/ariac_ws
  • Here is the caveat, the first argument of the COPY command (ariac_ws) should be in your context, i.e., it should also be in the directory ariac-docker/ariac-competitor/ariac-competitor. There are some ways to copy files and directories from outside the context but I will need to make some modifications and also long testing...and I will break things.
  • It's probably a good idea to paste the above command right after FROM zeidknist/ariac4-competitor-base-melodic:latest in Dockerfile
  1. Modify build_team_system.bash:
  • Remove commands that create a workspace and fetch the source code (wget).
  • cd into the workspace (/home/ariac-user/ariac_ws) and compile it.

from ariac.

zeidk avatar zeidk commented on August 22, 2024

I will close this for now. Please follow the instructions above and let me know if I need to reopen this ticket.

from ariac.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.