
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
dockerpuller
Advanced tools
A tiny microservice/cli tool that will push/pull Docker images for you.
Let's say you need to deploy a Docker container to your staging machine after your CI tests are done.
You might have a section in your .travis.yml
(or other .yml
) that has something like this:
after_success:
- docker build -t me/my-container .
- docker push me/my-conainer
- ./scripts/deploy.sh
And then in your deploy.sh
something like:
#!/bin/bash
ssh deploy@$MY_SECRET_SERVER << EOF
docker stop my-killer-app
docker rm my-killer-app
docker rmi me/my-container:current
docker pull me/my-container:latest
docker tag me/my-container:latest me/my-container:current
docker run -d --restart always --name my-killer-app -p 3000:3000 me/my-container
EOF
And that sort of does the job, but every time you set up a new project you need to do a bunch of setup like SSH keys, putting that deploy.sh
in the project, etc.
With Dockerpuller you can just put
"scripts": {
"deploy": "dockerpuller --deploy"
}
And run npm run deploy
instead of that deploy.sh
script.
Step 1.
Okay, first things first, install Dockerpuller globally on your Docker host:
npm install -g dockerpuller
Step 2.
After that, set the DOCKERPULLER_SECRET
and optionally PORT
environment variables and start Dockerpuller:
PORT=7777 DOCKERPULLER_SECRET="PorgsWereNotOverused12345" dockerpuller
To run it as a service, you can use PM2 or Forever.
Step 2.5.
Then in your CI create the DOCKERPULLER_SECRET
environment variable and set it to the same value as on your Docker host.
Step 3.
Configure your project. Install Dockerpuller and add deploy
script to your package.json:
npm install --save-dev dockerpuller
"scripts": {
"deploy": "dockerpuller --deploy"
}
By default, Dockerpuller will read config from package.json, so let's also add that:
"scripts": {
"deploy": "dockerpuller --deploy"
},
"config": {
"dockerpuller": {
"host": "http://mydockerhost.com:7777",
"image": "me/my-container",
"ports": "3000:3000",
"name": "my-killer-app"
}
}
If you don't want to add config field to your package.json, Dockerpuller also supports respective CLI options. Or CURL. Both will be explained in a bit.
NOTE: Dockerpuller will not create Dockerfile
for you. Don't forget to have it in place.
Step 4.
Change your .travis.yml
(or other .yml
) to the following:
after_success:
- docker build -t me/my-container .
- docker push me/my-conainer
- - ./scripts/deploy.sh
+ - npm run deploy
Step 4.25
By the way, you can have Dockerpuller build the container for you by adding a --build
option.
Let's do that:
package.json:
"scripts": {
"deploy": "dockerpuller --build --deploy"
}
.travis.yml (or other .yml
)
after_success:
- - docker build -t me/my-container .
- - docker push me/my-conainer
- - ./scripts/deploy.sh
+ - npm run deploy
And you're done! Now just let the magic happen.
If you don't want to set config in package.json
, Dockerpuller supports following CLI options:
-h, --host [host]
- Config: Docker host URL-n, --name [name]
- Config: Docker container name-p, --ports [ports]
- Config: Port bindings (i.e. 80:3000
)--deploy
- Run deployment--build
- Build an image before deployingIf you don't want to add Dockerpuller to your project's dependencies (no one wants another dependency), you can run your deployment by running a CURL command on your CI:
curl -X "POST" "http://mydockerhost:7777" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{ \
"secret": "'"$DOCKERPULLER_SECRET"'", \
"ports": "80:3000", \
"container": "me/my-container", \
"name": "my-killer-app" \
}'
And you're done!
FAQs
Tiny microservice/cli that will push/pull Docker images for you
The npm package dockerpuller receives a total of 4 weekly downloads. As such, dockerpuller popularity was classified as not popular.
We found that dockerpuller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.