MCPcopy
hub / github.com/docker/compose / isAbs

Function isAbs

pkg/compose/cp.go:332–334  ·  view source on GitHub ↗

IsAbs is a platform-agnostic wrapper for filepath.IsAbs. On Windows, golang filepath.IsAbs does not consider a path \windows\system32 as absolute as it doesn't start with a drive-letter/colon combination. However, in docker we need to verify things such as WORKDIR /windows/system32 in a Dockerfile

(path string)

Source from the content-addressed store, hash-verified

330// by the daemon). This SHOULD be treated as absolute from a docker processing
331// perspective.
332func isAbs(path string) bool {
333 return filepath.IsAbs(path) || strings.HasPrefix(path, string(os.PathSeparator))
334}
335
336func splitCpArg(arg string) (ctr, path string) {
337 if isAbs(arg) {

Callers 3

copyToContainerMethod · 0.85
copyFromContainerMethod · 0.85
splitCpArgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected