-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker: Add helper recipe #31
base: master
Are you sure you want to change the base?
Conversation
My distro RUST setup is not running it out of the box so I used a more recent one. For the record the observed error was: error[E0599]: no variant or associated item named `OutOfMemory` found for enum `ErrorKind` in the current scope -> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/sqlx-core-0.5.10/src/sqlite/connection/establish.rs:107:32 Forwarded: astarte-platform#31 Relate-to: astarte-platform#20 Signed-off-by: Philippe Coval <philippe.coval@astrolabe.coop>
10b96cc
to
de26f19
Compare
For development you should consider using rustup instead of the distribution's packaged compiler, as recommended by the rust project Also, the docker build should be added to the CI if we want to support this |
ok I thought about this too |
Using officla rust's docker image as base. For the record it can be rebased on ubuntu:21.10 (and cargo should be added to base packages) My distro RUST setup is not running it out of the box so I used a more recent one. For the record the observed error was: error[E0599]: no variant or associated item named `OutOfMemory` found for enum `ErrorKind` in the current scope -> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/sqlx-core-0.5.10/src/sqlite/connection/establish.rs:107:32 Forwarded: astarte-platform#31 Relate-to: astarte-platform#20 Signed-off-by: Philippe Coval <philippe.coval@astrolabe.coop>
de26f19
to
7d44d79
Compare
"the docker build should be added to the CI if we want to support this" this can be done in next patch using github actions ? |
Dockerfile
Outdated
&& cargo install --path . \ | ||
|| cargo install --examples --path . \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this really needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me double check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it's needed I have updated the commit message
Dockerfile
Outdated
|
||
WORKDIR "${workdir}" | ||
ENTRYPOINT [ "cargo" ] | ||
CMD [ "run", "--example", "simple", "--help" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the expected usage is, feel free to add instructions into the readme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the default run command , it could be overridden when using docker run ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but now it's calling --help for cargo, overriding --example, it doesn't do anything as it is. I can get what the idea was but I think we should fix this and document the intended usage anyway, because a dockerfile can be use in different ways (for example to produce binaries in a volume)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--help for example will be displayed not cargo
Dockerfile
Outdated
@@ -0,0 +1,43 @@ | |||
#!/bin/echo docker build . -f | |||
# -*- coding: utf-8 -*- | |||
# SPDX-License-Identifier: MPL-2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of the project is licensed under Apache 2.0, is it ok to have a single file under a different license?
CC: @bettio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mistake let me align
Using official rust's docker image as base. For the record it can be rebased on ubuntu:21.10 (and cargo should be added to base packages) My distro RUST setup is not running it out of the box so I used a more recent one. For the record the observed error was: error[E0599]: no variant or associated item named `OutOfMemory` found for enum `ErrorKind` in the current scope -> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/sqlx-core-0.5.10/src/sqlite/connection/establish.rs:107:32 Install example is needed because there is no default installation rule: error: there is nothing to install in `astarte_sdk v0.1.0 (/local/src/astarte-device-sdk-rust)`, because it has no binaries Forwarded: astarte-platform#31 Relate-to: astarte-platform#20 Signed-off-by: Philippe Coval <philippe.coval@astrolabe.coop>
7d44d79
to
c7a87d9
Compare
Using official rust's docker image as base. Usage is straight forward: ``` docker run astarte-device-sdk-rust:latest run --example simple -- \ --credentials-secret $credentialssecret \ --device-id $deviceid \ --pairing-url $pairingurl \ --realm $realm ``` For the record it can be rebased on ubuntu:21.10 (and cargo should be added to base packages) My distro RUST setup is not running it out of the box so I used a more recent one. For the record the observed error was: error[E0599]: no variant or associated item named `OutOfMemory` found for enum `ErrorKind` in the current scope -> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/sqlx-core-0.5.10/src/sqlite/connection/establish.rs:107:32 Install example is needed because there is no default installation rule: error: there is nothing to install in `astarte_sdk v0.1.0 (/local/src/astarte-device-sdk-rust)`, because it has no binaries Forwarded: astarte-platform#31 Relate-to: astarte-platform#20 Signed-off-by: Philippe Coval <philippe.coval@astrolabe.coop>
c7a87d9
to
2b09b12
Compare
Using official rust's docker image as base. Usage is straight forward: ``` docker run astarte-device-sdk-rust:latest run --example simple -- \ --credentials-secret $credentialssecret \ --device-id $deviceid \ --pairing-url $pairingurl \ --realm $realm ``` For the record it can be rebased on ubuntu:21.10 (and cargo should be added to base packages) My distro RUST setup is not running it out of the box so I used a more recent one. For the record the observed error was: error[E0599]: no variant or associated item named `OutOfMemory` found for enum `ErrorKind` in the current scope -> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/sqlx-core-0.5.10/src/sqlite/connection/establish.rs:107:32 Install example is needed because there is no default installation rule: error: there is nothing to install in `astarte_sdk v0.1.0 (/local/src/astarte-device-sdk-rust)`, because it has no binaries Forwarded: astarte-platform#31 Relate-to: astarte-platform#20 Signed-off-by: Philippe Coval <philippe.coval@astrolabe.coop>
2b09b12
to
c184760
Compare
My distro RUST setup is not running it out of the box
so I used a more recent one.
For the record here is is the observed error:
error[E0599]: no variant or associated item named
OutOfMemory
found for enumErrorKind
in the current scope-> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/sqlx-core-0.5.10/src/sqlite/connection/establish.rs:107:32
Relate-to: #20
Signed-off-by: Philippe Coval philippe.coval@astrolabe.coop