Sledgehammer
is a lightweight wrapper around docker to offer you native tools executed in docker containers.
It has been created to support dependency isolated executions and reduces the need to install tools locally.
Check that your Docker is version 17.12
or later, which will have the required Docker API 1.35. Run docker version
to check your Docker version.
You can start the installation of Sledgehammer with the following command:
docker run adobe/slh
Sledgehammer will then guide you through the installation.
You need two steps in order to fully install Sledgehammer on your system.
- Mount the docker socket
- Pass in a local executable path
In the simplest case and on most systems you can mount the docker socket with
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock adobe/slh
You need to mount a local directory (which should be in your path) to the /bin
direcotry of the container.
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v <localPath>:/bin adobe/slh
That should install Sledgehammer sucessfully on your system.
Sledgehammer will also tell you what to to during the installation.
Sledgehammer requires the docker API to be 1.35 or higherOnce installed you can use Sledgehammer with the slh
executable (given that the path you installed Sledgehammer to is in your PATH).
Sledgehammer - Dependency isolated executions. Use dockerized tools like they are installed on the system.
Usage:
slh [command]
Available Commands:
create Create a ressources
delete Delete a resource
describe Describe detailed information about ressources
get Get ressources
help Help about any command
install Install a tool on the system
reset Reset an alias
update Update all registries
Flags:
--confdir string Location of configuration directory. Default is bindir/.slh
-h, --help help for slh
--log-level string Set the log level (debug|info|warning|error|fatal|panic) (default "none")
-o, --output string Define the output, currently supported is text|json (default "text")
--version version for slh
Use "slh [command] --help" for more information about a command.
Sledgehammer has the concept of registries where in each registry there can be any amount of tools and tool kits.
Sledgehammer ships with a registry by default (called default
), so to see what tools are provided you can use
slh get tools
This should list all available tools, the same can be done with registries, tool kits as well as mounts.
slh get registries
slh get kits
slh get mounts
To install a tool you can use the install command
slh install <toolname> <flags>
Sledgehammer will then create a symlink with the tool name, so that you can call the tool with
<toolname> <arguments>
Sledgehammer supports versioned tools. That means you can have multiple versions of a single tool installed on the system.
By default Sledgehammer will take the latest version available following semantic versioning.
So with the following versions
latest
1.0.0
1.2.0
Sledgehammer will use version 1.2.0
by default.
Details can be found in the versioning documentation.
To build this project, you need Docker and Make:
make pr # will just test the project
make ci # will build the docker image
This will generate an adobe/slh
image locally which can then be installed as stated above.
As Sledgehammer is a go project you can also place the repository in a valid go path (<GOPATH>/src/github.com/adobe/sledgehammer
) and execute:
go test ./...
To build the installer:
cd installer && go build
or to build the slh executable:
cd slh && go build
Contributions are welcomed! Read the Contributing Guide for more information.
This project is licensed under the Apache V2 License. See LICENSE for more information.