Title: Building in a jenkins pipeline with docker. · Issue #46 · rust-serverless/lambda-rust · GitHub
Open Graph Title: Building in a jenkins pipeline with docker. · Issue #46 · rust-serverless/lambda-rust
X Title: Building in a jenkins pipeline with docker. · Issue #46 · rust-serverless/lambda-rust
Description: I am struggling to sort two things out. I am attempting to build inside a declarative jenkins pipeline. Like this: def container = docker.image("rustserverless/lambda-rust").run( '-i ' + '--env CARGO_FLAGS=--arm64 ' + '-u "$(id -u)":"$(i...
Open Graph Description: I am struggling to sort two things out. I am attempting to build inside a declarative jenkins pipeline. Like this: def container = docker.image("rustserverless/lambda-rust").run( '-i ' + '--env CAR...
X Description: I am struggling to sort two things out. I am attempting to build inside a declarative jenkins pipeline. Like this: def container = docker.image("rustserverless/lambda-rust").run( '-i ...
Opengraph URL: https://github.com/rust-serverless/lambda-rust/issues/46
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Building in a jenkins pipeline with docker.","articleBody":"I am struggling to sort two things out. I am attempting to build inside a declarative jenkins pipeline. Like this:\r\n\r\n```groovy\r\ndef container = docker.image(\"rustserverless/lambda-rust\").run(\r\n '-i ' +\r\n '--env CARGO_FLAGS=--arm64 ' +\r\n '-u \"$(id -u)\":\"$(id -g)\" ' +\r\n '-v ${PWD}:/code '\r\n)\r\n```\r\n\r\nThis fails with:\r\n\r\n```\r\nerror: Found argument '--arm64' which wasn't expected, or isn't valid in this context\r\n\r\n\tIf you tried to supply `--arm64` as a value rather than a flag, use `-- --arm64`\r\n```\r\n\r\nFair enough, that was based on a custom argument for `cargo lambda`. I'm not sure how to correctly target arm64 in this context.\r\n\r\n---\r\n\r\nEven if I remove this, though, I get:\r\n\r\n```\r\nCaused by:\r\n failed to create directory `/cargo/registry/index/github.com-1ecc6299db9ec823`\r\n\r\nCaused by:\r\n Permission denied (os error 13)\r\n```\r\n\r\nBut, I don't understand as I haven't mounted a volume for the registry so it seems these should be within the container. Seems this container should have all the permissions required to create a directory within the container, and I thought mounting these were optional for improved builds. Any help would be appreciated.\r\n\r\n---\r\n\r\nMaybe the right thing to do is just install cargo-lambda within the container. I'm not really sure what the correct workflow is here.\r\n\r\n---\r\n\r\nActually, I can't run this locally either. Running with podman on mac, presents the same error.\r\n\r\n```\r\n✗ podman run --rm \\\r\n -u \"$(id -u)\":\"$(id -g)\" \\\r\n -v ${PWD}:/code \\\r\n rustserverless/lambda-rust\r\nerror: failed to get `aws-config` as a dependency of package `mft-rotator v0.1.0 (/code)`\r\n\r\nCaused by:\r\n failed to create directory `/cargo/registry/index/github.com-1ecc6299db9ec823`\r\n\r\nCaused by:\r\n Permission denied (os error 13)\r\n```\r\n\r\nAnd even if I try to mount a volume with which it can do anything it wants:\r\n\r\n```\r\n✗ podman run --rm \\\r\n -u \"$(id -u)\":\"$(id -g)\" \\\r\n -v ${PWD}:/code \\\r\n -v ~/tmpcargo:/cargo \\\r\n rustserverless/lambda-rust\r\n\r\n/usr/local/bin/build.sh: line 38: /cargo/env: No such file or directory\r\n```\r\n\r\nor:\r\n\r\n```\r\n✗ podman run --rm \\\r\n -u \"$(id -u)\":\"$(id -g)\" \\\r\n -v ${PWD}:/code \\\r\n -v ${HOME}/tmpcargo/registry:/cargo/registry \\\r\n -v ${HOME}/tmpcargo/git:/cargo/git \\\r\n rustserverless/lambda-rust\r\n\r\nerror: failed to get `aws-config` as a dependency of package `mft-rotator v0.1.0 (/code)`\r\n\r\nCaused by:\r\n failed to create directory `/cargo/registry/index/github.com-1ecc6299db9ec823`\r\n\r\nCaused by:\r\n Permission denied (os error 13)\r\n```\r\n\r\nI'm not sure how to use this in any case.","author":{"url":"https://github.com/theherk","@type":"Person","name":"theherk"},"datePublished":"2022-08-29T22:45:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/46/lambda-rust/issues/46"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b8ca6b55-ceed-eb7a-25f7-e23d15f738ac |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 97F4:11DFBA:11F34D4:16B28FD:69915D67 |
| html-safe-nonce | 088fb2d3d433e0cd69718adb3c0987d1de12f4ed564cf0def1224cada6f91c39 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0Y0OjExREZCQToxMUYzNEQ0OjE2QjI4RkQ6Njk5MTVENjciLCJ2aXNpdG9yX2lkIjoiMjA5OTU2NDE4ODU0ODU1NDA4OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 69cffddc806f8e657aec945cf06724d42e9d0f6138eae2ea5d5c5840cdc3507b |
| hovercard-subject-tag | issue:1354951718 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/rust-serverless/lambda-rust/46/issue_layout |
| twitter:image | https://opengraph.githubassets.com/017cff05a543f58fec9e70609237620e2d837e06ece04816e35e6dd3e433af89/rust-serverless/lambda-rust/issues/46 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/017cff05a543f58fec9e70609237620e2d837e06ece04816e35e6dd3e433af89/rust-serverless/lambda-rust/issues/46 |
| og:image:alt | I am struggling to sort two things out. I am attempting to build inside a declarative jenkins pipeline. Like this: def container = docker.image("rustserverless/lambda-rust").run( '-i ' + '--env CAR... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theherk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/rust-serverless/lambda-rust git https://github.com/rust-serverless/lambda-rust.git |
| octolytics-dimension-user_id | 88410118 |
| octolytics-dimension-user_login | rust-serverless |
| octolytics-dimension-repository_id | 392490725 |
| octolytics-dimension-repository_nwo | rust-serverless/lambda-rust |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 160704679 |
| octolytics-dimension-repository_parent_nwo | softprops/lambda-rust |
| octolytics-dimension-repository_network_root_id | 160704679 |
| octolytics-dimension-repository_network_root_nwo | softprops/lambda-rust |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width