scp
Performs copying of files and directories to and from a remote server over SCP using password or IdentityFile.Example (CopyFromRemoteWithOption)
no available example in current languagefunc (e *Examples) Scp_CopyFromRemoteWithOption(sshd *dagger.Service, key *dagger.Secret, path string) *dagger.File {
return dag.Scp().
Config("admin@sshd", dagger.ScpConfigOpts{
Port: 8022,
BaseCtr: dag.Scp().BaseContainer().WithServiceBinding("sshd", sshd),
}).
WithIdentityFile(key).
FileFromRemote(path)
}no available example in current languageno available example in current languageExample (UsePassword)
no available example in current languagefunc (e *Examples) Scp_UsePassword(destination string, password string, file *dagger.File) *dagger.Container {
return dag.Scp().
Config(destination).
WithPassword(dag.SetSecret("password", password)).
FileToRemote(file)
}no available example in current languageno available example in current languageExample (CopyToRemote)
no available example in current languagefunc (e *Examples) Scp_CopyToRemote(destination string, key *dagger.Secret, file *dagger.File) *dagger.Container {
return dag.Scp().
Config(destination).
WithIdentityFile(key).
FileToRemote(file)
}no available example in current languageno available example in current languageExample (CopyFromRemote)
no available example in current languagefunc (e *Examples) Scp_CopyFromRemote(destination string, key *dagger.Secret, path string) *dagger.File {
return dag.Scp().
Config(destination).
WithIdentityFile(key).
FileFromRemote(path)
}no available example in current languageno available example in current languageExample (CopyDirectoryToRemote)
no available example in current languagefunc (e *Examples) Scp_CopyDirectoryToRemote(destination string, key *dagger.Secret, dir *dagger.Directory, target string) *dagger.Container {
return dag.Scp().
Config(destination).
WithIdentityFile(key).
DirectoryToRemote(dir, target)
}no available example in current languageno available example in current languageExample (CopyToRemoteWithOption)
no available example in current languagefunc (e *Examples) Scp_CopyToRemoteWithOption(sshd *dagger.Service, key *dagger.Secret, file *dagger.File, target string) *dagger.Container {
return dag.Scp().
Config("admin@sshd", dagger.ScpConfigOpts{
Port: 8022,
BaseCtr: dag.Scp().BaseContainer().WithServiceBinding("sshd", sshd),
}).
WithIdentityFile(key).
FileToRemote(file, dagger.ScpCommanderFileToRemoteOpts{
Target: target,
})
}no available example in current languageno available example in current languageInstallation
dagger install github.com/seungyeop-lee/daggerverse/scp@v0.2.5Entrypoint
Return Type
Scp Example
dagger -m github.com/seungyeop-lee/daggerverse/scp@dff464356b5c6d990a4d9831da933dea06ac1087 call \
func (m *MyModule) Example() *dagger.Scp {
return dag.
Scp()
}@function
def example() -> dagger.Scp:
return (
dag.scp()
)@func()
example(): Scp {
return dag
.scp()
}Types
Scp 🔗
SCP dagger module
baseContainer() 🔗
Get the base container for the SCP module. Used when you need to inject a Service into a BaseContainer and run it.
Example:
dag.Scp().Config("admin@sshd", ScpConfigOpts{
Port: 8022,
BaseCtr: dag.Scp().BaseContainer().WithServiceBinding("sshd", sshd),
})...
Note: When a Service is passed directly as a parameter to an external Dagger function, it does not bind to the container created inside the Dagger function. (Confirmed in v0.13.3)
Return Type
Container ! Example
dagger -m github.com/seungyeop-lee/daggerverse/scp@dff464356b5c6d990a4d9831da933dea06ac1087 call \
base-containerfunc (m *MyModule) Example() *dagger.Container {
return dag.
Scp().
BaseContainer()
}@function
def example() -> dagger.Container:
return (
dag.scp()
.base_container()
)@func()
example(): Container {
return dag
.scp()
.baseContainer()
}config() 🔗
Set configuration for SCP connections.
Return Type
Config !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| destination | String ! | - | destination to connect ex) user@host |
| port | Integer | 22 | port to connect |
| baseCtr | Container | - | base container |
Example
dagger -m github.com/seungyeop-lee/daggerverse/scp@dff464356b5c6d990a4d9831da933dea06ac1087 call \
config --destination stringfunc (m *MyModule) Example(destination string) *dagger.ScpConfig {
return dag.
Scp().
Config(destination)
}@function
def example(destination: str) -> dagger.ScpConfig:
return (
dag.scp()
.config(destination)
)@func()
example(destination: string): ScpConfig {
return dag
.scp()
.config(destination)
}Config 🔗
SCP configuration
withPassword() 🔗
Set the password as the SCP connection credentials.
Return Type
Commander !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| arg | Secret ! | - | password |
Example
dagger -m github.com/seungyeop-lee/daggerverse/scp@dff464356b5c6d990a4d9831da933dea06ac1087 call \
config --destination string \
with-password --arg env:MYSECRETfunc (m *MyModule) Example(destination string, arg *dagger.Secret) *dagger.ScpCommander {
return dag.
Scp().
Config(destination).
WithPassword(arg)
}@function
def example(destination: str, arg: dagger.Secret) -> dagger.ScpCommander:
return (
dag.scp()
.config(destination)
.with_password(arg)
)@func()
example(destination: string, arg: Secret): ScpCommander {
return dag
.scp()
.config(destination)
.withPassword(arg)
}withIdentityFile() 🔗
Set up identity file with SCP connection credentials.
Note: Tested against RSA-formatted and OPENSSH-formatted private keys.
Return Type
Commander !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| arg | Secret ! | - | identity file |
Example
dagger -m github.com/seungyeop-lee/daggerverse/scp@dff464356b5c6d990a4d9831da933dea06ac1087 call \
config --destination string \
with-identity-file --arg env:MYSECRETfunc (m *MyModule) Example(destination string, arg *dagger.Secret) *dagger.ScpCommander {
return dag.
Scp().
Config(destination).
WithIdentityFile(arg)
}@function
def example(destination: str, arg: dagger.Secret) -> dagger.ScpCommander:
return (
dag.scp()
.config(destination)
.with_identity_file(arg)
)@func()
example(destination: string, arg: Secret): ScpCommander {
return dag
.scp()
.config(destination)
.withIdentityFile(arg)
}Commander 🔗
SCP command launcher
container() 🔗
Returns a container that is ready to launch SCP command.
Return Type
Container ! Example
dagger -m github.com/seungyeop-lee/daggerverse/scp@dff464356b5c6d990a4d9831da933dea06ac1087 call \
config --destination string \
with-identity-file --arg env:MYSECRET \
containerfunc (m *MyModule) Example(destination string, arg *dagger.Secret) *dagger.Container {
return dag.
Scp().
Config(destination).
WithIdentityFile(arg).
Container()
}@function
def example(destination: str, arg: dagger.Secret) -> dagger.Container:
return (
dag.scp()
.config(destination)
.with_identity_file(arg)
.container()
)@func()
example(destination: string, arg: Secret): Container {
return dag
.scp()
.config(destination)
.withIdentityFile(arg)
.container()
}fileToRemote() 🔗
Copy a file to a remote server.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | File ! | - | source file |
| target | String | - | destination path (If not entered, '.' is used as the default) |
Example
dagger -m github.com/seungyeop-lee/daggerverse/scp@dff464356b5c6d990a4d9831da933dea06ac1087 call \
config --destination string \
with-identity-file --arg env:MYSECRET \
file-to-remote --source file:pathfunc (m *MyModule) Example(destination string, arg *dagger.Secret, source *dagger.File) *dagger.Container {
return dag.
Scp().
Config(destination).
WithIdentityFile(arg).
FileToRemote(source)
}@function
def example(destination: str, arg: dagger.Secret, source: dagger.File) -> dagger.Container:
return (
dag.scp()
.config(destination)
.with_identity_file(arg)
.file_to_remote(source)
)@func()
example(destination: string, arg: Secret, source: File): Container {
return dag
.scp()
.config(destination)
.withIdentityFile(arg)
.fileToRemote(source)
}fileFromRemote() 🔗
Copy a file from a remote server.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | String ! | - | source path |
Example
dagger -m github.com/seungyeop-lee/daggerverse/scp@dff464356b5c6d990a4d9831da933dea06ac1087 call \
config --destination string \
with-identity-file --arg env:MYSECRET \
file-from-remote --source stringfunc (m *MyModule) Example(destination string, arg *dagger.Secret, source string) *dagger.File {
return dag.
Scp().
Config(destination).
WithIdentityFile(arg).
FileFromRemote(source)
}@function
def example(destination: str, arg: dagger.Secret, source: str) -> dagger.File:
return (
dag.scp()
.config(destination)
.with_identity_file(arg)
.file_from_remote(source)
)@func()
example(destination: string, arg: Secret, source: string): File {
return dag
.scp()
.config(destination)
.withIdentityFile(arg)
.fileFromRemote(source)
}directoryToRemote() 🔗
Copy a directory to a remote server.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | source directory |
| target | String ! | - | destination path (If the path is an already existing directory, it will be copied to the '[path]/source-dir' location) |
Example
dagger -m github.com/seungyeop-lee/daggerverse/scp@dff464356b5c6d990a4d9831da933dea06ac1087 call \
config --destination string \
with-identity-file --arg env:MYSECRET \
directory-to-remote --source DIR_PATH --target stringfunc (m *MyModule) Example(destination string, arg *dagger.Secret, source *dagger.Directory, target string) *dagger.Container {
return dag.
Scp().
Config(destination).
WithIdentityFile(arg).
DirectoryToRemote(source, target)
}@function
def example(destination: str, arg: dagger.Secret, source: dagger.Directory, target: str) -> dagger.Container:
return (
dag.scp()
.config(destination)
.with_identity_file(arg)
.directory_to_remote(source, target)
)@func()
example(destination: string, arg: Secret, source: Directory, target: string): Container {
return dag
.scp()
.config(destination)
.withIdentityFile(arg)
.directoryToRemote(source, target)
}directoryFromRemote() 🔗
Copy a directory from a remote server.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | String ! | - | source path |
Example
dagger -m github.com/seungyeop-lee/daggerverse/scp@dff464356b5c6d990a4d9831da933dea06ac1087 call \
config --destination string \
with-identity-file --arg env:MYSECRET \
directory-from-remote --source stringfunc (m *MyModule) Example(destination string, arg *dagger.Secret, source string) *dagger.Directory {
return dag.
Scp().
Config(destination).
WithIdentityFile(arg).
DirectoryFromRemote(source)
}@function
def example(destination: str, arg: dagger.Secret, source: str) -> dagger.Directory:
return (
dag.scp()
.config(destination)
.with_identity_file(arg)
.directory_from_remote(source)
)@func()
example(destination: string, arg: Secret, source: string): Directory {
return dag
.scp()
.config(destination)
.withIdentityFile(arg)
.directoryFromRemote(source)
}