For a list of options, see " docker create options. Use to configure additional Docker container resource options. Example: Mounting volumes in a container volumes: - my_docker_volume:/volume_mount - /data/my_data - /source/directory:/destination/directory Setting container resource options The is a volume name or an absolute path on the host machine, and is an absolute path in the container. To specify a volume, you specify the source and destination path: You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host. Important: An action can access the GITHUBTOKEN through the github.token context even if the workflow does not explicitly pass the GITHUBTOKEN to the action. You can use volumes to share data between services or other steps in a job. Use to set an array of volumes for the container to use. Use to set an array of ports to expose on the container. Use to set a map of environment variables in the container. Example: Defining credentials for a container registry container: image: ghcr.io/owner/image credentials: username: $ Using environment variables with a container The credentials are the same values that you would provide to the docker login command. If the image's container registry requires authentication to pull the image, you can use to set a map of the username and password. Defining credentials for a container registry ![]() The value can be the Docker Hub image name or a registry name. Use to define the Docker image to use as the container to run the action. Introduction to GitHub Actions Docker Docs Created with Sketch. Replace with the regional or multi-regional location of the repository where the image is stored. Replace with configured service account in workload identity provider which has access to push to GCR. jobs: container-test-job: runs-on: ubuntu-latest container: node:18 Defining the container image Replace with configured workload identity provider.When you only specify a container image, you can omit the image keyword. Jobs: container-test-job: runs-on: ubuntu-latest container: image: node:18 env: NODE_ENV: development ports: - 80 volumes: - my_docker_volume:/volume_mount options: -cpus 1 steps: - name: Check for dockerenv file run: (ls /.dockerenv & echo Found dockerenv) || (echo No dockerenv) ![]() ![]() Run: (ls /.dockerenv & echo Found dockerenv) || (echo No dockerenv)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |