-
-
Notifications
You must be signed in to change notification settings - Fork 72
✨ Add Docker Support #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Introduces a Dockerfile for containerized execution of the script with all dependencies pre-installed. Updates the README with a new 'Docker Usage' section, including build and run instructions, to simplify usage for users who prefer or require Docker.
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
pcaversaccio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored in 1e78d2f to use Docker Compose. Let me know how you think about it. The docker-compose.yml file is hardened with respect to permissions.
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
pcaversaccio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified the files a bit further and added the following additional security configurations (the last two configurations):
security_opt:
- no-new-privileges:true # Prevent privilege escalation.
- apparmor=docker-default # Set the `AppArmor` profile for Ubuntu/Debian/openSUSE (restrict file/network access).
- label=type:container_t # Set the `SELinux` profile for RHEL/CentOS/Fedora (provide mandatory access control).
🕓 Changelog
This PR adds a complete Docker setup, allowing the script to be run in a containerised environment. It includes a hardened
compose.yamlfile for easy, secure, and reproducible runs.Building the Docker Image
Build the Docker image using Docker Compose:
docker-compose buildBasic Usage
To run the script using Docker Compose, use the
compose.yamlfile provided in the repository. The container is namedsafe-tx-hashes-util.Example displaying help:
docker-compose run --rm safe-tx-hashes-util --helpExample calculating the Safe transaction hashes:
docker-compose run --rm safe-tx-hashes-util --network arbitrum --address 0x111CEEee040739fD91D29C34C33E6B3E112F2177 --nonce 234Using Message Files
When calculating off-chain message hashes, you need to provide a local directory containing your message file. The included
compose.yamlconfiguration mounts the./datadirectory by default.With Environment Variables
You can pass environment variables directly via Docker Compose: