Skip to content

Commit fb76b08

Browse files
committed
Updated grammar to mom and chef's requests
1 parent fd96e67 commit fb76b08

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

_posts/2020-05-19-docker-rust-notpresent.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ categories: [docker, rust]
1818
<p>Today, a friend posted the following snippet in Slack:</p>
1919
<pre> [~/Documents/shelflife] [±docker✗] $ docker run -v -it --rm --name my-running-app shelflife-rust-docker
2020
Error: NotPresent</pre>
21-
<p>The first guess was they deleted the docker image and forgot to rebuild it. That wasn't the case, leading me to dive into this cryptic error message that we assumed some some hidden Rust or Docker error. We weren't able to find any example of this error message for Rust or Docker online, so I knew this would be a fun challenge.</p>
21+
<p>The first guess was that they had deleted the docker image and forgot to rebuild it. That wasn't the case, leading me to dive into this cryptic error message that we assumed was some hidden Rust or Docker error. We weren't able to find any example of this error message for Rust or Docker online, so I knew this would be a fun challenge.</p>
2222

23-
<p>The first thing I did was to make sure the path to the binary was working, it'd be silly if this wasn't working because <code>/usr/local/bin</code> wasn't in the container's PATH. I changed the last line in the Dockerfile from <code>CMD ["shelflife"]</code> to <code>ENTRYPOINT ["/usr/local/bin/shelflife"]</code>. The error persisted, which means it wasn't a PATH error. Of course this couldn't be easy.</p>
23+
<p>The first thing I did was to make sure the path to the binary was working, as it'd be silly if this wasn't working because <code>/usr/local/bin</code> wasn't in the container's PATH. I changed the last line in the Dockerfile from <code>CMD ["shelflife"]</code> to <code>ENTRYPOINT ["/usr/local/bin/shelflife"]</code>. The error persisted, which meant it wasn't a PATH error. Of course this couldn't be easy.</p>
2424

25-
<p>The next step in diagnosis was to get a shell on the container. That'd typically be done via <code>docker exec</code>, but that only works on a running container, which we didn't have. To get around this, I changed the last line of the Dockerfile to <code>ENTRYPOINT ["/bin/bash"]</code>, which makes <code>docker run -it</code> drop you into an interactive bash shell. This means I can easily see what's going on and run commands from inside the container.</p>
25+
<p>The next step in diagnosis was to get a shell on the container. That would typically be done via <code>docker exec</code>, but that only works on a running container, which we didn't have. To get around this, I changed the last line of the Dockerfile to <code>ENTRYPOINT ["/bin/bash"]</code>, which makes <code>docker run -it</code> drop you into an interactive bash shell. This means I could easily see what was going on and run commands from inside the container.</p>
2626

27-
<p>Now that I had a shell, I navigated to <code>/usr/local/bin/</code> and ran <code>./shelflife</code> to check if there was any output docker was hiding. Unfortunately, there wasn't. I was at roughly the same place as when I started - a cryptic error message and no idea where it was coming from. At least now we can be decently sure it's not a docker issue.</p>
27+
<p>Now that I had a shell, I navigated to <code>/usr/local/bin/</code> and ran <code>./shelflife</code> to check if there was any output docker was hiding. Unfortunately, there wasn't. I was at roughly the same place as when I started - a cryptic error message and no idea where it was coming from. At least now I was decently sure it wasn't not a docker issue.</p>
2828

29-
<p>I'd ran into issues with dynamically linked libraries not being installed in the past, so I used <code>ldd</code> (List Dynamic Dependencies) to make sure all the dependencies existed. Everything looked fine, and I double-checked by manually installing the library packages for everythin <code>ldd</code> said was linked. Everything was already installed, and the error persisted.</p>
29+
<p>I'd run into issues with dynamically linked libraries not being installed in the past, so I used <code>ldd</code> (List Dynamic Dependencies) to make sure all the dependencies existed. Everything looked fine, and I double-checked by manually installing the library packages for everything <code>ldd</code> said was linked. Everything was already installed, but the error persisted.</p>
3030

3131
<p>The last thing I tried was installing <code>strace</code>, a tool for tracing system calls, and running <code>strace ./shelflife</code>. This gave me a huge output full of system calls, but near the bottom was something that looked familiar, the text "NotPresent". Now I knew I was on the right path! The relevant output that got me to the final answer was the following:</p>
3232

0 commit comments

Comments
 (0)