{"id":22180664,"url":"https://github.com/jftuga/dls","last_synced_at":"2025-10-05T12:53:02.741Z","repository":{"id":57641385,"uuid":"256308214","full_name":"jftuga/dls","owner":"jftuga","description":"Docker ls - list files within a container","archived":false,"fork":false,"pushed_at":"2020-04-20T13:00:25.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T18:50:44.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jftuga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-16T19:18:50.000Z","updated_at":"2021-11-09T08:25:06.000Z","dependencies_parsed_at":"2022-09-04T23:01:59.433Z","dependency_job_id":null,"html_url":"https://github.com/jftuga/dls","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jftuga/dls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fdls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fdls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fdls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fdls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jftuga","download_url":"https://codeload.github.com/jftuga/dls/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fdls/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278457470,"owners_count":25989956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T09:19:03.641Z","updated_at":"2025-10-05T12:53:02.715Z","avatar_url":"https://github.com/jftuga.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dls\ndocker ls - list files within a container\n\n## Description\n\nThis program is used to view what files and directories reside inside a running docker container.  This program is most useful when using the\n[Scratch](https://hub.docker.com/_/scratch) docker image or when `ls` is not provided.\nIt is also helpful when using an image / container that you are not familiar with.\n\nIn your `Dockerfile`,\nyou will need to `ADD` or `COPY` a **statically linked** `dls` binary *(see below)*.\n\n## Usage\n\n```\ndls: Get file info for a directory\nusage: dls [directory]\n  -a\tshow all files, including .git, dev, proc, and sys\n  -b\tshow in bare format, eg: no tables\n  -e\tshow file/directory errors\n  -t\tshow total file size of all files\n  -v\tshow version and then exit\n\nCurrent directory is the default if no other directory is given on cmd-line\n```\n\n## Example\n\n* dls.exe -t\n\n```\n+-----------+---------------------+------+------------------------+\n|   SIZE    |      MOD TIME       | TYPE | NAME (FILES:11 DIRS:2) |\n+-----------+---------------------+------+------------------------+\n|      1086 | 2020-04-16 15:21:34 | F    | LICENSE                |\n|        50 | 2020-04-16 15:21:34 | F    | README.md              |\n|      4525 | 2020-04-16 23:12:31 | F    | cmd.go                 |\n|   3209728 | 2020-04-16 23:12:39 | F    | dls.exe                |\n|        81 | 2020-04-16 23:09:12 | F    | osver_darwin.go        |\n|        82 | 2020-04-16 23:10:13 | F    | osver_freebsd.go       |\n|        80 | 2020-04-16 23:09:47 | F    | osver_linux.go         |\n|       964 | 2020-04-16 23:05:04 | F    | osver_windows.go       |\n|         0 | 2020-04-16 23:15:46 | D    | test1\\                 |\n|       351 | 2020-04-16 23:15:41 | F    | test1\\file1.txt        |\n|       856 | 2020-04-16 23:15:46 | F    | test1\\file2.txt        |\n|         0 | 2020-04-16 23:16:03 | D    | test2\\                 |\n|       581 | 2020-04-16 23:16:04 | F    | test2\\file3.txt        |\n| --------- | ------------------- | -    | ---------------        |\n|           |             3218384 |      | (total size)           |\n|           |                3.07 |      | (MB total size)        |\n+-----------+---------------------+------+------------------------+\n```\n\n* dls.exe -b\n\n```\nLICENSE\nREADME.md\ncmd.go\ndls.exe\nosver_darwin.go\nosver_freebsd.go\nosver_linux.go\nosver_windows.go\ntest1\\\ntest1\\file1.txt\ntest1\\file2.txt\ntest2\\\ntest2\\file3.txt\n```\n\n\n## Docker\n\n### Static Binary Complication\n\n| Platform | Command\n----------|-----\n| windows | go build -tags netgo -ldflags \"-extldflags -static\"\n| linux/bsd | go build -tags netgo -ldflags '-extldflags \"-static\" -s -w'\n| macos | go build -ldflags '-s -extldflags \"-sectcreate __TEXT __info_plist Info.plist\"'\n| android | go build -ldflags -s\n\n**NOTE:** *I have not been able to test all of these*\n\n### Windows\n* You will need to use `nanoserver` with a matching OS version: [Docker Image List](https://hub.docker.com/_/microsoft-windows-nanoserver)\n* * Running `dls -v` will return your specific `OS build`\n* Example for Windows 10 LTSC Build 1809:\n* * `docker pull mcr.microsoft.com/windows/nanoserver:10.0.17763.1158`\n\n### Linux\n* Remember to create a static version of the binary\n* `dls` can be started from the [Docker Scratch Image](https://hub.docker.com/_/scratch)\n\n### References\n* [Building Minimal Docker Containers for Go Applications](https://rollout.io/blog/building-minimal-docker-containers-for-go-applications/)\n* [\"Distroless\" Docker Images](https://github.com/GoogleContainerTools/distroless)\n* [Statically compiling Go programs](https://www.arp242.net/static-go.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Fdls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjftuga%2Fdls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Fdls/lists"}