-
Notifications
You must be signed in to change notification settings - Fork 15
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
oq does not work in a docker container #39
Comments
@sundipnair Is there any reason you're wanting to build the binary from source versus just copying the binary from the latest release into the image? I'm thinking this is some sort of Crystal issue. I would try just using a prebuilt binary within your image. FROM crystallang/crystal:latest
RUN apt update && apt install -y jq
COPY ./oq /bin/oq
RUN chmod +x /bin/oq
RUN /bin/oq --help Seems to work fine, and probably would be the more ideal way. I'll keep this open until the Crystal issue is fixed. |
thanks for your reply. so where do you find the ./oq? I get an error Step 3/5 : COPY ./oq /bin/oq |
Oh sorry. I got it from the latest release assets https://github.com/Blacksmoke16/oq/releases/tag/v0.2.1. Then renamed it from |
thanks. that builds the image alright. however running oq gives the following error cat template.yml | oq -o json -i yaml
|
Need to provide the Try Where in this case the |
Thanks .. |
@Blacksmoke16 , I have added some instuctions to the read me to craete a docker container. I have pushed a branch called docker_install_instrcution. how do I get this PR'd. |
https://github.com/Blacksmoke16/oq#contributing Would be the thing to reference. Should just be able to make it from your fork to this repo. |
@sundipnair Actually after thinking about this more; I think it would be better to just actually create an image and have it available to use, versus just documenting how to do that. (Or at least also mention how to include I can take care of this, don't think it 'll be too hard. |
OK. Thanks.
…On Tue, 5 Nov 2019 at 15:59, Blacksmoke16 ***@***.***> wrote:
@sundipnair <https://github.com/sundipnair> Actually after thinking about
this more; I think it would be better to just actually create an image and
have it available to use, versus just documenting how to do that. (Or at
least also mention how to include oq into an existing image).
I can take care of this, don't think it 'll be too hard.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#39?email_source=notifications&email_token=AKIRQLYPXQBMS7545UJY2HDQSGJ7RA5CNFSM4JIR2GKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDDGDKY#issuecomment-549872043>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKIRQL4AD3LHFG5ENMCUXGLQSGJ7RANCNFSM4JIR2GKA>
.
|
I'll also add a section to the readme on using EDIT: See my latest comment. |
@Blacksmoke16 , Good one. I was able to build my own image and work with that ... I will play with your container for some of my personal stuff and see how it goes. Might be worth adding the docker link on the Readme file. |
Actually, @sundipnair what is your use case for needing The binary on Github is statically linked so at this point the image isn't doing much more than installing EDIT: Er, I assume you really just want to get |
@Blacksmoke16 , Just wanted to dynamically edit a yaml as part of a ci/cd step. So needed |
👍 Perfect, https://github.com/Blacksmoke16/oq#docker should cover how to do that. |
I have build a docker container like so
FROM crystallang/crystal:latest
RUN git clone https://github.com/Blacksmoke16/oq.git
WORKDIR /oq
RUN shards build --production
RUN chmod +x /oq/bin/oq
RUN cp /oq/bin/oq /bin/
ENV PATH /bin/:$PATH
RUN oq --help
I get an error when running oq --help
Sending build context to Docker daemon 5.632kB
Step 1/8 : FROM crystallang/crystal:latest
---> e9906ad8c49f
Step 2/8 : RUN git clone https://github.com/Blacksmoke16/oq.git
---> Using cache
---> 9989d5d29ddb
Step 3/8 : WORKDIR /oq
---> Using cache
---> 9a3f277c8558
Step 4/8 : RUN shards build --production
---> Using cache
---> 1ed78db07894
Step 5/8 : RUN chmod +x /oq/bin/oq
---> Using cache
---> 0ebaf7c94a18
Step 6/8 : RUN cp /oq/bin/oq /bin/
---> Using cache
---> e02d9d996fff
Step 7/8 : ENV PATH /bin/:$PATH
---> Using cache
---> 6bc2e585cc6e
Step 8/8 : RUN oq --help
---> Running in d0822a0f3af4
Failed to raise an exception: END_OF_STACK
[0x490bb6] *CallStack::print_backtrace:Int32 +118
[0x46d466] __crystal_raise +86
[0x46d98e] ???
[0x4bbab6] *Crystal::System::File::open<String, String, File::Permissions>:Int32 +214
[0x4b7ec3] *File::new<String, String, File::Permissions, Nil, Nil>:File +67
[0x48785d] *CallStack::read_dwarf_sections:(Array(Tuple(UInt64, UInt64, String)) | Nil) +109
[0x4875ed] *CallStack::decode_line_number:Tuple(String, Int32, Int32) +45
[0x486d78] *CallStack#decode_backtrace:Array(String) +296
[0x486c32] *CallStack#printable_backtrace:Array(String) +50
[0x4f049d] *Exception+ +77
[0x4f02e8] *Exception+ +120
[0x4ec07a] *AtExitHandlers::run:Int32 +490
[0x55510b] *Crystal::main<Int32, Pointer(Pointer(UInt8))>:Int32 +139
[0x477e76] main +6
[0x7f0eb572e830] __libc_start_main +240
[0x46ba19] _start +41
[0x0] ???
The command '/bin/sh -c oq --help' returned a non-zero code: 5
Please can you help identify the issue. Thanks.
The text was updated successfully, but these errors were encountered: