I have multiple Ruby applications that are run in crons using IronWorker. I am new to Docker and I want to test the application locally before pushing the code to Iron. How do I do that?
How can I launch an IronWorker with Docker without needing to pay for private Docker repositories, nor make my code public?
277 Views Asked by Evan Appleby At
1
There are 1 best solutions below
Related Questions in RUBY
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- Duplicate GET requests - Rails & Heroku
- convert csv file with json data inside to a column, rows table in 2nd csv file
- Installing dependencies from a gemspec file
- Verifying Google Identity OAuth2 token with Ruby
- Java code of AES/GCM/NoPadding encryption algorithm with authentication tag
- How to fix error in model with gem lockbox
- Cannot install Ruby Gem on Window
- use logstash filter ,aes gcm encrypted in ruby,but cannot decrypted in java
- In Rails 7, what is the right ActiveRecord callback to use if I need to prevent (or rollback) persistance on error?
- How can I go through an array and still remove elements from it
- Nokogiri only returning 5 results
- How do I get the fullscreen mode in firefox?
- undefined group option when using branch reset group regex in Ruby
Related Questions in DOCKER
- sqlplus myusername/mypassword@ORCL not working with Oracle on Docker
- Golang == Error: OCI runtime create failed: unable to start container process: exec: "./bin": stat ./bin: no such file or directory: unknown
- Only the first SQL script gets executed inside Docker Postgres container
- Retrieve the Dockerfile configuration from the Kubernetes and also change container Java parameter?
- Polars with Rust: Out of Memory Error when Processing Large Dataset in Docker Using Streaming
- Compiling eBPF program in Docker fails due to missing '__u64' type
- AttributeError: module 'numba' has no attribute 'generated_jit'
- Phoenix in a docker dev environment - generated code can't be saved from VSCode
- Docker on Multipass VMs: Connecting worker nodes to swarm results in rcp error
- Facing error in creating image of my react+vite project . Dockerfile error
- NextJS Docker build fails: fetch failed ECONNREFUSED
- Docker container unable to make HTTPS requests to external API
- Failed to connect to your instance after deploying mern app on aws ec2 instance when i try to access frontend
- Connecting to Postgres running in a Docker container using psql
- Can't connect to local postgresql server from my docker container
Related Questions in IRON.IO
- The difference between project token and user token - clarification needed
- Iron.io set up getting 404 Not Found on `iron register` step
- How to throttle message delivery to consumers?
- Remote build doesn't install dependencies using python 3.2 standard runtime
- How can I launch an IronWorker with Docker without needing to pay for private Docker repositories, nor make my code public?
- How to prevent ironworker from enqueuing tasks of workers that are still running?
- Can only install one of: iron-io/iron_mq[2.0.0, 1.5.3] -- Laraworker vs ironQueue
- How to divide workers and aggregate results?
- How to integrate slack with IronWorker tasks to get its status
- What are the Docker RUN params for mimicking IronWorker memory constraints?
- How to re-link files in iron.io?
- Laravel 5.2 Delete a queue in Job
- How to use MongoDB driver of PHP in an iron worker task?
- Laravel 4 Queue Taking Long Time
- Iron.io Workers PHP error Class 'PDO' not found
Related Questions in IRONWORKER
- Certificate has expired [CERT_HAS_EXPIRED]
- How to require dependencies for ruby IronWorker
- Remote build doesn't install dependencies using python 3.2 standard runtime
- How can I launch an IronWorker with Docker without needing to pay for private Docker repositories, nor make my code public?
- How to prevent ironworker from enqueuing tasks of workers that are still running?
- Can only install one of: iron-io/iron_mq[2.0.0, 1.5.3] -- Laraworker vs ironQueue
- How to divide workers and aggregate results?
- How to integrate slack with IronWorker tasks to get its status
- What are the Docker RUN params for mimicking IronWorker memory constraints?
- How to use MongoDB driver of PHP in an iron worker task?
- Iron.io Workers PHP error Class 'PDO' not found
- How can I set NODE_ENV variable for ironworker (iron.io) task?
- ironWorker not inserting to my database
- task runner/queue/scheduling on openshift with django
- Updating field of million of document from a worker
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Your code can be stored privately on Iron.io and the image on Docker can include only the programming language and libraries and be made public. I've put together a "hello world" example showing how it can be done. I am using Alpine linux and the Ruby programming language along with Iron's dev packages. I also included the "pg" gem:
hello.rb
Gemfile
Dockerfile
Here are the steps to get this running:
In this example, the name of the Docker username is testuser and the name of the Docker repository is testrepo.
Run the following command in a Docker Terminal. I have added a tag "0.0.1". This should be incremented with each change to the image that is pushed to Docker.
Since the Dockerfile did not include an ENTRYPOINT ["ruby", "hello.rb"] line, any terminal command can be included in a "docker run" command. To get into an image with a bash prompt, you would run:
Once inside of bash, you can then see if the code can be executed:
In this example, I received the following error:
To fix that, update the Dockerfile to install json and then re-test the image. Here is the updated Dockerfile:
Now that we know the code will run correctly with the image, we can update the Dockerfile and push the image to Docker and the code to Iron.
FROM iron/ruby-2.3:dev
RUN apk update && apk upgrade
RUN gem install pg --no-ri --no-rdoc
RUN gem install json --no-ri --no-rdoc
RUN apk add bash
docker build -t testuser/testrepo:0.0.1 .
docker push testuser/testrepo:0.0.1
iron register testuser/testrepo:0.0.1
zip -r hello.zip hello.rb
iron worker upload --zip hello.zip --name hello testuser/testrepo:0.0.1 ruby hello.rb
Done! You can now schedule an IronWorker through the HUD or through their API.