Answers: <p>Yes your understanding is correct. The full documentation is here <a href="https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container" rel="nofollow noreferrer">https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2022-10-11T21:23:40.137Z
Answers: 2022-10-11T21:23:40.137Z
Answers: Levi
Answers: <ol>
  <li><p>We should have docker images in the dockerhub. if we require customized docker image we can create docker image using the docker file</p>
  </li>
  <li><p>We can create application.yml files by using github actions workflow.</p>
  </li>
  <li><p>Application.yaml file for docker containers looks like this:</p>
  </li>
  </ol>
  <p>name: container # Workflow-name</p>
  <p>on: push #when a push is made to branch in the workflow's repository</p>
  <p>jobs: # Actionsto be performed after push happened</p>
  <p>node-docker:</p>
  <pre><code>runs-on: ubuntu-latest# Running OS on which actions will be performed 
  
  container: 
  
    image: node:14.15.0-alpine3.12 # docker-image-tag, it will pull from Dockerhub and container get created 
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2022-11-17T06:07:18.167Z
Answers: 2022-11-17T06:07:18.167Z
Answers: Nitor Infotech
Answers: <p>Creating a Dockerfile
  In your new hello-world-docker-action directory, create a new Dockerfile file. Make sure that your filename is capitalized correctly (use a capital D but not a capital f) if you're having issues. For more information, see &quot;Dockerfile support for GitHub Actions.&quot;</p>
  <p>Dockerfile</p>
  <pre><code># Container image that runs your code
  FROM alpine:3.10
  
  # Copies your code file from your action repository to the filesystem path `/` of the container
  COPY entrypoint.sh /entrypoint.sh
  
  # Code file to execute when the docker container starts up (`entrypoint.sh`)
  ENTRYPOINT [&quot;/entrypoint.sh&quot;]
  </code></pre>
  <p>Creating an action metadata file
  Create a new action.yml file in the hello-world-docker-action directory you created above. For more information, see &quot;Metadata syntax for GitHub Actions.&quot;</p>
  <p>action.yml</p>
  <pre><code>YAML
  # action.yml
  name: 'Hello World'
  description: 'Greet someone and record the time'
  inputs:
    who-to-greet:  # id of input
      description: 'Who to greet'
      required: true
      default: 'World'
  outputs:
    time: # id of output
      description: 'The time we greeted you'
  runs:
    using: 'docker'
    image: 'Dockerfile'
    args:
      - ${{ inputs.who-to-greet }}
  </code></pre>
  <p>This metadata defines one who-to-greet input and one time output parameter. To pass inputs to the Docker container, you should declare the input using inputs and pass the input in the args keyword. Everything you include in args is passed to the container, but for better discoverability for users of your action, we recommended using inputs.</p>
  <p>GitHub will build an image from your Dockerfile, and run commands in a new container using this image.</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-09-11T12:32:49.857Z
Answers: This appears like an answer generated by some poorly trained AI model. The question was "Is that correct?". So, is it?
Answers: Greendrake
Answers: CC BY-SA 4.0
Answers: 2023-05-17T16:55:58.083Z
Answers: Or rather a copy from the Github manual.
Answers: Kamiccolo
Answers: CC BY-SA 4.0
Answers: 2022-09-11T12:15:59.710Z
Answers: 2022-09-11T12:15:59.710Z
Answers: Iman Jafari
Body: <p>Consider this GA workflow:</p>
  <pre class="lang-yaml prettyprint-override"><code>name: My GA Workflow
  
  on: push
  
  jobs:
    myJobName:
      runs-on: ubuntu-latest
      container: cypress/included:10.6.0
      steps:
        - name: Ensure tools are available
          shell: bash
          run: |
            apt-get update &amp;&amp; \
            apt-get install -y unzip zstd netcat
  
      # and so on...
  </code></pre>
  <p>I would like to have a crystal clear understanding what happens there. Currently I reckon:</p>
  <ol>
  <li>GA will run a <code>ubuntu-latest</code> virtual machine with docker engine pre-installed.</li>
  <li>It will pull and run <code>cypress/included:10.6.0</code>.</li>
  <li><em>All</em> the steps will run inside the Cypress docker container, not on the Ubuntu machine.</li>
  </ol>
  <p>Is that correct?</p>
  
Comments: CC BY-SA 4.0
Comments: 2022-09-11T11:06:01.130Z
Comments: This seems to be covered in the Github docs: https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container
Comments: Ben Cottrell
Tags: <docker><github-actions><workflow>
Title: How does Github Actions work with docker containers?
UserDisplayName: Greendrake
ThreadText: # How does Github Actions work with docker containers?
  
  (Asked by: username_0 on 2022-09-11)
  
  Consider this GA workflow:
  
  ```yaml
  name: My GA Workflow
  
  on: push
  
  jobs:
    myJobName:
      runs-on: ubuntu-latest
      container: cypress/included:10.6.0
      steps:
        - name: Ensure tools are available
          shell: bash
          run: |
            apt-get update && \
            apt-get install -y unzip zstd netcat
  
      # and so on...
  
  ```
  
  I would like to have a crystal clear understanding what happens there. Currently I reckon:
  
  1. GA will run a `ubuntu-latest` virtual machine with docker engine pre-installed.
  2. It will pull and run `cypress/included:10.6.0`.
  3. *All* the steps will run inside the Cypress docker container, not on the Ubuntu machine.
  
  Is that correct?
  
  **Tags:** docker, github-actions, workflow
  
  > **Comments:**
  > **username_1**: This seems to be covered in the Github docs: https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2022-10-11. Score: 2 | Accepted answer
  
  Yes your understanding is correct. The full documentation is here <https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container>
  
  
  ---
  
  ### Answer by username_3 on 2022-11-17. Score: 0
  
  1. We should have docker images in the dockerhub. if we require customized docker image we can create docker image using the docker file
  2. We can create application.yml files by using github actions workflow.
  3. Application.yaml file for docker containers looks like this:
  
  name: container # Workflow-name
  
  on: push #when a push is made to branch in the workflow's repository
  
  jobs: # Actionsto be performed after push happened
  
  node-docker:
  
  ```
  runs-on: ubuntu-latest# Running OS on which actions will be performed 
  
  container: 
  
    image: node:14.15.0-alpine3.12 # docker-image-tag, it will pull from Dockerhub and container get created 
  
  ```
  
  
  ---
  
  ### Answer by username_4 on 2022-09-11. Score: -1
  
  Creating a Dockerfile
  In your new hello-world-docker-action directory, create a new Dockerfile file. Make sure that your filename is capitalized correctly (use a capital D but not a capital f) if you're having issues. For more information, see "Dockerfile support for GitHub Actions."
  
  Dockerfile
  
  ```
  # Container image that runs your code
  FROM alpine:3.10
  
  # Copies your code file from your action repository to the filesystem path `/` of the container
  COPY entrypoint.sh /entrypoint.sh
  
  # Code file to execute when the docker container starts up (`entrypoint.sh`)
  ENTRYPOINT ["/entrypoint.sh"]
  
  ```
  
  Creating an action metadata file
  Create a new action.yml file in the hello-world-docker-action directory you created above. For more information, see "Metadata syntax for GitHub Actions."
  
  action.yml
  
  ```
  YAML
  # action.yml
  name: 'Hello World'
  description: 'Greet someone and record the time'
  inputs:
    who-to-greet:  # id of input
      description: 'Who to greet'
      required: true
      default: 'World'
  outputs:
    time: # id of output
      description: 'The time we greeted you'
  runs:
    using: 'docker'
    image: 'Dockerfile'
    args:
      - ${{ inputs.who-to-greet }}
  
  ```
  
  This metadata defines one who-to-greet input and one time output parameter. To pass inputs to the Docker container, you should declare the input using inputs and pass the input in the args keyword. Everything you include in args is passed to the container, but for better discoverability for users of your action, we recommended using inputs.
  
  GitHub will build an image from your Dockerfile, and run commands in a new container using this image.
  
  > **Comments:**
  > **username_0**: This appears like an answer generated by some poorly trained AI model. The question was "Is that correct?". So, is it?  
  > **username_5**: Or rather a copy from the Github manual.  
  
  ---
  
  