oracle / smith Goto Github PK
View Code? Open in Web Editor NEWSmith: A microcontainer builder
License: Other
Smith: A microcontainer builder
License: Other
I have followed the instructions and everything is working smoothly until it comes time to upload. For the life of me I can't figure out why smith can't parse the repo name. I copied and pasted the exact command in the example.
/home/nwellinghoff/smith/smith-httpd# smith upload -r \
https://nwellinghoff:@registry-1.docker.io/nwellinghoff/smith-httpd
-i smith-httpd.tar.gz
WARN[0000] pigz binary not found, falling back to internal gzip
ERRO[0000] Failed to upload image to https://nwellinghoff:@registry-1.docker.io/nwellinghoff/smith-httpd: Reponame must be specified
I am able to upload the image manually by doing a
cat smith-httpd.tar.gz | docker import - nwellinghoff/smith-httpd:latest
then
docker push nwellinghoff/smith-httpd
but it would be nice if the smith command worked as well.
When using smith upload -d -r https://jruser:[email protected]/reponame
, the blobs POST is made without the username and password credentials. The private registry I'm using (artifactory) rejects the attempt with a 403 code because of the missing credentials.
(When I changed PrepPutObject to use req.SetBasicAuth, artifactory responded with a 404 due to a bug of its own, but that's beside the point.)
The code seems to be customized to the public Docker registry and its associated token server, and not to private ones which use the recommended basic auth setup.
Smith makes index.json
files with the obsolete annotation keys org.opencontainers.ref.name
and org.opencontainers.created
. Those keys were renamed before the final 1.0 release of the image spec (see opencontainers/image-spec@8ec42b7).
This is a critical bug, because skopeo version 0.1.23 now expects the 1.0 image spec format, and it is current in the rhel7 extras repo.
I'm currently working on trying to transition some containers to using Smith. I am interested in the project and am looking for documentation which would help with not having to read through the source (my current solution).
Is there a source of documentation that I can refer to? If so, it may be worth linking to it in the README.
Getting the following error when trying to run smith inside a container: standard_init_linux.go:207: exec user process caused "exec format error"
When packaging an image, Smith does not copy across extended attributes on the files.
This means that users that need capability bits for running an image as non-root need to apply these retroactively to the image in new layers.
To fix, I assume we need some work in pack.go to copy across the PAXRecords from the file info to the tar headers in a similar way to https://golang.org/src/archive/tar/common.go?s=22088:22153#L619
DEBU[0000] Uploading manifests/latest
ERRO[0000] Failed to upload image to http://user:pw@registry/repo/image: Put request returned invalid response 400:
{"errors":[{"code":"MANIFEST_INVALID","message":"manifest invalid","detail":{}}]}
I receive this error when I attempt to smith upload my image.tar.gz to the registry. Taking a peek at index.json, this line sticks out:
{"schemaVersion":2,"manifests":[{"mediaType":"application/vnd.smith.spec+json",},{"mediaType":"application/vnd.oci.image.manifest.v1+json","com.oracle.smith.version":"1.1.2.12.23acefc","org.opencontainers.image.created":"2017-10-31T21:19:31Z","org.opencontainers.image.ref.name":"latest"},"platform":{"architecture":"amd64","os":"linux"}}]}
Any idea why that mediaType is pointing to v1?
I'm running smith inside an Alpine Docker container. After running smith some of the standard commands are broken, like sh
and ls
, but pwd
still works.
~ # ls
Error loading shared library libssl.so.39: No such file or directory (needed by /bin/ls)
Error loading shared library libcrypto.so.38: No such file or directory (needed by /bin/ls)
Error relocating /bin/ls: X509_NAME_get_text_by_NID: symbol not found
This does not occur in a Debian container.
I tried this tool on an Alpine based image that contains one fully statically linked executable that I would like to extract. The smith.yaml
file looks like this:
type: oci
package: remarkify.gz.tar
paths:
- /usr/local/bin/remarkify
cmd:
- /usr/local/bin/remarkify
When I run the tool I get this output:
INFO[0000] Building in /tmp/smith-build-443054379
INFO[0000] Installing package
INFO[0000] Installing package remarkify.gz.tar
WARN[0000] pigz binary not found, falling back to internal gzip
INFO[0004] Removing /tmp/smith-unpack-0
WARN[0010] chmod failed:
WARN[0010] Could not make paths readable: Error starting chmod -R go+rX /usr/local/bin/remarkify: fork/exec /usr/bin/chmod: no such file or directory
WARN[0010] ldconfig failed:
INFO[0010] Failed to install remarkify.gz.tar: Error starting ldconfig -v -N -X /: fork/exec /usr/sbin/ldconfig: no such file or directory
INFO[0010] Removing /tmp/smith-build-443054379
The executable is there:
# ls /tmp/smith-unpack-0/usr/local/bin/remarkify
/tmp/smith-unpack-0/usr/local/bin/remarkify
Doing the same thing but with a Debian based image gives the same result. I also tried with a Fedora based image, this works. To me it looks like it tries to find /usr/bin/chmod
and /usr/sbin/ldconfig
inside the unpacked image. These two paths don't exist in the Debian or Alpine based images. In those images these tools are located in /bin/chmod
and /sbin/ldconfig
.
I also tried the final example on [1], same issue.
[1] https://hackernoon.com/how-to-build-a-tiny-httpd-container-ae622c37db39
Hello I'm trying to see if this tool can shrink my oracle-slim-7 docker image(I believe it's OCI compliant).
I have the image built locally but I don't understand how I can use smith to turn it into a microcontainer. Do I need to set up a whole registry to do this?
I created an image using smith
. I uploaded it to a local docker registry using the -d
flag to convert it to a Docker image. I then pulled down the image locally and it works perfectly fine. Running docker images
shows that the image was created 292 years ago. I also pushed the image to my private GitLab instance, which contains a built-in Docker registry. Viewing the registry in GitLab resulted in a 500 page and an exception was thrown due to an invalid date.
One can argue that GitLab should be able to handle this since it works fine in Docker, both locally and in my local registry. But I think it would be really nice if smith
could set the date correctly, if possible.
I've already reported an issue to GitLab: https://gitlab.com/gitlab-org/gitlab-ce/issues/34988.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.