Git Product home page Git Product logo

Comments (17)

jacob-carlborg avatar jacob-carlborg commented on July 24, 2024

BTW, there's a long list of symbols missing from OpenSSL, I just included the first one.

from smith.

vishvananda avatar vishvananda commented on July 24, 2024

I need a little more clarification. You are saying that after running smith on a host that the commands on the host are broken? That is highly unexpected. Does it appear that libssl.so is being deleted or overwritten somehow?

from smith.

vishvananda avatar vishvananda commented on July 24, 2024

It would also be worth running smith with the -v option to see if any of the debug statements report doing something that looks fishy like overwriting files it shouldn't be.

from smith.

vishvananda avatar vishvananda commented on July 24, 2024

Also, it would be helpful if you could list complete reproduction steps so that I can try to replicate. i.e. how are you building smith? how are you building your alpine container etc. I have been planning to try running smith inside a container but I have not experimented with it yet.

from smith.

brunoborges avatar brunoborges commented on July 24, 2024

Based on your issue, @jacob-carlborg, it seems you built a Docker image that has Smith inside. If that's what you did, post the Dockerfile you wrote to build the image.

from smith.

jacob-carlborg avatar jacob-carlborg commented on July 24, 2024

I need a little more clarification. You are saying that after running smith on a host that the commands on the host are broken?

Yes.

Does it appear that libssl.so is being deleted or overwritten somehow?

No.

from smith.

jacob-carlborg avatar jacob-carlborg commented on July 24, 2024

Based on your issue, jacob-carlborg, it seems you built a Docker image that has Smith inside

Yes.

If that's what you did, post the Dockerfile you wrote to build the image.

I'm working on setting up a reproducible test.

from smith.

jacob-carlborg avatar jacob-carlborg commented on July 24, 2024

I haven't been able to create a full working example because smith has some issues downloading my Docker image. But this is what I've got: the problem seems to be related to running smith inside an Alpine based Docker image and using smith to build a micro container based on Alpine that contains wget.

Dockerfile:

FROM golang:1.9-alpine

RUN apk add git make --update
RUN git clone https://github.com/oracle/smith
RUN cd smith && make install && cd ..

ADD smith.yaml /go
RUN ls
RUN smith
RUN ls

smith.yaml:

package: https://registry-1.docker.io/library/jacobcarlborg/docker-alpine-wget
paths:
  - /etc/issue

Docker image used by smith: https://hub.docker.com/r/jacobcarlborg/docker-alpine-wget.

from smith.

brunoborges avatar brunoborges commented on July 24, 2024

Can you please provide full log of your docker build command for this Dockerfile?

from smith.

vishvananda avatar vishvananda commented on July 24, 2024

thanks for these steps. I will try to reproduce and see how far I get

from smith.

jacob-carlborg avatar jacob-carlborg commented on July 24, 2024

Here's the output of building the Docker image. I removed the output of building smith, to save space:

Sending build context to Docker daemon  4.096kB
Step 1/8 : FROM golang:1.9-alpine
1.9-alpine: Pulling from library/golang
Digest: sha256:b1e919dc95e12de74fa42ec56b47db31728c02313900c35c5a2b885782100971
Status: Image is up to date for golang:1.9-alpine
 ---> 91cae16c7e05
Step 2/8 : RUN apk add git make --update
 ---> Running in 9b54bd033943
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
(1/6) Installing libssh2 (1.8.0-r1)
(2/6) Installing libcurl (7.54.0-r0)
(3/6) Installing expat (2.2.0-r1)
(4/6) Installing pcre (8.40-r2)
(5/6) Installing git (2.13.0-r0)
(6/6) Installing make (4.2.1-r0)
Executing busybox-1.26.2-r5.trigger
OK: 25 MiB in 18 packages
 ---> 2cb309204371
Removing intermediate container 9b54bd033943
Step 3/8 : RUN git clone https://github.com/oracle/smith
 ---> Running in 4273a422d9a0
Cloning into 'smith'...
 ---> 0024736b3109
Removing intermediate container 4273a422d9a0
Step 4/8 : RUN cd smith && make install && cd ..
 ---> Running in 8316bcf14cea
mkdir -p build/src/github.com/oracle
rm -rf build
install -D smith /usr/bin/smith
 ---> 8c5a06c667e9
Removing intermediate container 8316bcf14cea
Step 5/8 : ADD smith.yaml /go
 ---> 933182363679
Removing intermediate container 5c9053f065eb
Step 6/8 : RUN ls
 ---> Running in 1a46fd6cdd4f
bin
smith
smith.yaml
src
 ---> 9f6a58c84a10
Removing intermediate container 1a46fd6cdd4f
Step 7/8 : RUN smith -v
 ---> Running in 1d0a7161ea2e
time="2017-07-19T06:48:36Z" level=info msg="Building in /tmp/smith-build-887148005"
time="2017-07-19T06:48:36Z" level=info msg="Installing package"
time="2017-07-19T06:48:36Z" level=info msg="Installing package http://docker/jacobc/alpine/wget"
time="2017-07-19T06:48:36Z" level=debug msg="Downloading manifests/latest"
time="2017-07-19T06:48:37Z" level=debug msg="Retrying manifests/latest with a token"
time="2017-07-19T06:48:37Z" level=debug msg="Making auth request to http://docker/jwt/auth?service=container_registry&scope=repository:jacobc/alpine/wget:pull"
time="2017-07-19T06:48:37Z" level=debug msg="Downloading manifests/latest"
time="2017-07-19T06:48:37Z" level=info msg="Downloaded manifests/latest"
time="2017-07-19T06:48:37Z" level=debug msg="Downloading blobs/sha256:ef88c5cba029c927c6db56187abc8813a413f06e25a1ddec60c3e5669edbfceb"
time="2017-07-19T06:48:37Z" level=info msg="Downloaded blobs/sha256:ef88c5cba029c927c6db56187abc8813a413f06e25a1ddec60c3e5669edbfceb"
time="2017-07-19T06:48:37Z" level=debug msg="Downloading blobs/sha256:6d987f6f42797d81a318c40d442369ba3dc124883a0964d40b0c8f4f7561d913"
time="2017-07-19T06:48:37Z" level=info msg="Downloaded blobs/sha256:6d987f6f42797d81a318c40d442369ba3dc124883a0964d40b0c8f4f7561d913"
time="2017-07-19T06:48:37Z" level=debug msg="Downloading blobs/sha256:e7ad3cc5e009a009df93568cb27b98d546db880821068a1969239fcf8bcc7a2a"
time="2017-07-19T06:48:37Z" level=info msg="Downloaded blobs/sha256:e7ad3cc5e009a009df93568cb27b98d546db880821068a1969239fcf8bcc7a2a"
time="2017-07-19T06:48:37Z" level=info msg="Removing /tmp/smith-unpack-0"
time="2017-07-19T06:48:37Z" level=warning msg="pigz binary not found, falling back to internal gzip"
time="2017-07-19T06:48:37Z" level=debug msg="Executing /bin/chmod -R go+rX /etc/issue"
time="2017-07-19T06:48:37Z" level=debug msg="Executing /sbin/ldconfig -v -N -X /"
time="2017-07-19T06:48:37Z" level=debug msg="Copying file from: etc/issue to /tmp/smith-build-887148005/rootfs/etc/issue"
time="2017-07-19T06:48:37Z" level=info msg="Performing overlay"
time="2017-07-19T06:48:37Z" level=info msg="Packing image into /go/image.tar.gz"
time="2017-07-19T06:48:37Z" level=debug msg="Adding directory /tmp/smith-build-887148005/rootfs/dev to archive"
time="2017-07-19T06:48:37Z" level=debug msg="Adding directory /tmp/smith-build-887148005/rootfs/etc to archive"
time="2017-07-19T06:48:37Z" level=debug msg="Adding file /tmp/smith-build-887148005/rootfs/etc/issue to archive"
time="2017-07-19T06:48:37Z" level=debug msg="Adding directory /tmp/smith-build-887148005/rootfs/proc to archive"
time="2017-07-19T06:48:37Z" level=debug msg="Adding directory /tmp/smith-build-887148005/rootfs/read to archive"
time="2017-07-19T06:48:37Z" level=debug msg="Adding directory /tmp/smith-build-887148005/rootfs/run to archive"
time="2017-07-19T06:48:37Z" level=debug msg="Adding directory /tmp/smith-build-887148005/rootfs/sys to archive"
time="2017-07-19T06:48:37Z" level=debug msg="Adding directory /tmp/smith-build-887148005/rootfs/write to archive"
time="2017-07-19T06:48:37Z" level=info msg="DiffID of layer is sha256:6cf78733b533ff32144308a5481e6f63fc708b6c777ac5afc2aae373a0e7098f"
time="2017-07-19T06:48:37Z" level=info msg="Adding layer sha256:9c4488fffb71bbf36e674da44b17b4daf542025b0cdf63971a9fa35ae5e9074e to image"
time="2017-07-19T06:48:37Z" level=debug msg="Adding directory blobs to archive"
time="2017-07-19T06:48:37Z" level=debug msg="Adding directory blobs/sha256 to archive"
time="2017-07-19T06:48:38Z" level=debug msg="Adding file blobs/sha256/4dd48b930f8820699cb601a2cb421c641b7230f6d15816a2ba1690eb54b28cfe to archive"
time="2017-07-19T06:48:38Z" level=debug msg="Adding file blobs/sha256/7ee14937fa662e57daba5c36403135fa4bdb746b7e037a29e1e8cf93c5418509 to archive"
time="2017-07-19T06:48:38Z" level=debug msg="Adding file blobs/sha256/9c4488fffb71bbf36e674da44b17b4daf542025b0cdf63971a9fa35ae5e9074e to archive"
time="2017-07-19T06:48:38Z" level=debug msg="Adding file blobs/sha256/a1829e3fff1afb3ab9cab7b769dbfeeb216f20e401585d3a5d0d0e2106584888 to archive"
time="2017-07-19T06:48:38Z" level=debug msg="Adding file oci-layout to archive"
time="2017-07-19T06:48:38Z" level=debug msg="Adding file index.json to archive"
time="2017-07-19T06:48:38Z" level=info msg="Removing /tmp/smith-build-887148005"
 ---> 4668b6529f1d
Removing intermediate container 1d0a7161ea2e
Step 8/8 : RUN ls
 ---> Running in 3280faa55ce2
--2017-07-19 06:48:39--  http://ls/
Resolving ls... failed: Name does not resolve.
sh: unable to resolve host address 'ls'
The command '/bin/sh -c ls' returned a non-zero code: 4

For some reason I got a different error now. As I mentioned, smith fails to fetch the Docker image from the public docker registry so I had to use my private one.

from smith.

vishvananda avatar vishvananda commented on July 24, 2024

Ok I've reproduced the error and I'm looking into it. Btw the reason you couldn't download from dockerhub is you have an extra "library" in the url. It should be: https://registry-1.docker.io/jacobcarlborg/docker-alpine-wget

from smith.

vishvananda avatar vishvananda commented on July 24, 2024

it looks like somehow /bin/busybox is being replaced with wget which is very odd. I'm still investigating how that might happen

from smith.

vishvananda avatar vishvananda commented on July 24, 2024

Ok I have it working. This dockerfile works for me now

FROM golang:1.9-alpine

RUN apk add git make --update
RUN git clone -b fix-layer-overwrite https://github.com/oracle/smith
RUN (cd smith && make install)

ADD smith.yaml /go
RUN ls
RUN smith -v
RUN ls

from smith.

jacob-carlborg avatar jacob-carlborg commented on July 24, 2024

Btw the reason you couldn't download from dockerhub is you have an extra "library" in the url. It should be: https://registry-1.docker.io/jacobcarlborg/docker-alpine-wget

Aha, I thought library was part of the base URL. I just followed the examples here [1] [2].

[1] https://github.com/oracle/smith#build-types
[2] https://hackernoon.com/how-to-build-a-tiny-httpd-container-ae622c37db39

from smith.

jacob-carlborg avatar jacob-carlborg commented on July 24, 2024

Ok I have it working. This dockerfile works for me now

Thanks, I'll give it a try.

from smith.

jacob-carlborg avatar jacob-carlborg commented on July 24, 2024

It works now, thanks 😃.

from smith.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.