Copy files from a docker image to host folder
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- docker, shell
- Domain
- cli, documentation
Research direction
Review the repository's existing programming-tip documentation organization first, since no target file is named. Add the supplied Docker image copy and image-tag listing examples, and consider the work done when both usage examples are documented in the appropriate location.
Written by the indexing model from the issue text.
Description
1.Create an output folder in current directory, mount the folder to /output in a temp container,
and then copy the folder in the container to /output. That's all.
mkdir output && docker run --rm --mount type=bind,source="$(pwd)"/output,target=/output jni-faiss cp -r /opt/jni-faiss/cpu /output/
For example, copy linux-command static HTML files from linux-command image:
mkdir -p output && docker run --rm --mount type=bind,source="$(pwd)"/output,target=/output stilleshan/linux-command cp -r /usr/share/nginx/html /output/
2.list tags for a image
put the code to ~/.bash_profile or ~/.zshrc
function listTags() {
local repo=${1}
local size=${2:-25}
local page=${3:-1}
[ -z "${repo}" ] && echo "Usage: listTags <repoName> [size] [pageIndex]" 1>&2 && return 1
if [[ $repo == *"/"* ]]; then
curl "https://hub.docker.com/v2/repositories/${repo}/tags/?page=${page}&page_size=${size}" 2>/dev/null | jq -r '.results[].name' | sort
else
curl "https://registry.hub.docker.com/api/content/v1/repositories/public/library/${repo}/tags?page=${page}&page_size=${size}" 2>/dev/null | jq -r '.results[].name' | sort
fi
}
Then can listTag of a repository as:
listTags ubuntu
listTags redis
listTags gogs/gogs
- Dominant language
- Python
- Stars
- 5
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from davideuler/programming-tips
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 1/5 Under an hour Newbie friendliness 35/100
-
build milvus on Mac Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 28/100
All issues in davideuler/programming-tips
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100