Skip to content
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

how to keep shell environment included with slim #716

Open
wang2024666 opened this issue Sep 20, 2024 · 2 comments
Open

how to keep shell environment included with slim #716

wang2024666 opened this issue Sep 20, 2024 · 2 comments

Comments

@wang2024666
Copy link

Expected Behavior

keep shell env after slim build


Actual Behavior

we run with shell include as:
docker-slim --report /root/slim.report.json build
--http-probe=false
--continue-after=1
--include-shell=true
--include-oslibs-net=true
--include-ssh-client=true
ndsmodeler:20240914
the contiainer seems still missing the shell environment.
[root@localhost ~]# docker exec -it caf51e6fff9d /bin/bash
OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown
[root@localhost ~]# docker exec -it caf51e6fff9d /bin/sh
OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown
[root@localhost ~]# docker exec -it caf51e6fff9d sh
OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown
how can we keep the shell environment and basic os commands? the base image is CentOS Stream 8

Specifications

  • Version: 1.40.11
  • Platform: centos stream 8
@kcq
Copy link
Member

kcq commented Sep 23, 2024

@wang2024666 thank you for the report! This looks a bit strange... Definitely need to investigate it more. In the meantime, try using the --include-bin and/or --include-exe flags. Also try using the latest release

@wang2024666
Copy link
Author

@wang2024666 thank you for the report! This looks a bit strange... Definitely need to investigate it more. In the meantime, try using the --include-bin and/or --include-exe flags. Also try using the latest release
@kcq we tried the latest release with:
mint slim
--http-probe=false
--continue-after=1
--include-bin=/bin/bash \ (must with this flag, we can get the bash)
--include-shell=true
--include-oslibs-net=true
--include-ssh-client=true
ndsmodeler:20240914
then run the image, the bash is included,
docker exec -it f5e0cf56476a /bin/bash
bash-5.1# ls
bash: ls: command not found
bash-5.1# cd /app
bash-5.1# ls
bash: ls: command not found
bash-5.1# dir
bash: dir: command not found
bash-5.1# ll
bash: ll: command not found
bash-5.1# pwd
/app
bash-5.1# ls
bash: ls: command not found
bash-5.1# ping
bash: ping: command not found
bash-5.1# cat
bash: cat: command not found
but other basic commands like ls, cat, ping not in the image now. should we keek all the bin files one by one or other flags can be used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants