Comments (17)
I think the problem was due to some invisible extra characters.
I especially recommend ababkov's comment here for anybody googling this problem.
FYI - this was coming back with "./run: file does not exist" for me for any services i attempted to add. When the script was run directly on the box, the following additional info was presented: "Invalid interpreter /#!/bin/sh^M" (or similar).
Issue ended up being dos vs unix line endings. Running the init files through from dos2unix / http://www.virtualhelp.me/linux/164-dos2unix-missing-ubuntu-1004 resolved the issue for me after 4 hours of head banging...
Thank you for your help! :)
from baseimage-docker.
Yes this is a bug. See GH-45. Already fixed in git master, will release soon.
from baseimage-docker.
this bug still exist in version 0.9.16. what's wrong?
from baseimage-docker.
@moonbingbing what problem are you seeing? The image seems to work fine for me:
# docker run -i -t onix/test:0.9.16 /sbin/my_init -- bash
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/logtime.sh...
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 14
*** Running bash...
root@54e9871459ed:/#
On a sidenote, the bug from GH-45 is definitely fixed, but I'm not sure it was related because the pre-fix image also works without problems with the logtime example.
from baseimage-docker.
@OnixGH thanks for reply.
my docker file is
FROM phusion/baseimage:0.9.16
RUN mkdir -p /etc/my_init.d
ADD test.sh /etc/my_init.d/test.sh
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
test.sh content is
#In logtime.sh (make sure this file is chmod +x):
#!/bin/bash
/bin/date > /tmp/boottime.txt
the result is
sudo docker run -i -t ming/test /sbin/my_init -- bash
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/test.sh...
*** /etc/my_init.d/test.sh failed with status 127
*** Killing all processes...
from baseimage-docker.
@moonbingbing try removing the first comment line of test.sh, so that it starts with #!/bin/bash
. That works for me.
from baseimage-docker.
I've updated the documentation to help avoid this mistake.
from baseimage-docker.
👌
thx.
from baseimage-docker.
I'm having the same problem despite having #!/bin/bash
at the beginning of the file.
from baseimage-docker.
@Defozo Could you please paste your script content into a Gist and share it here?
from baseimage-docker.
I have no fancy code here. Just the one from the example:
Dockerfile:
FROM phusion/baseimage:0.9.19
RUN mkdir -p /etc/my_init.d
COPY logtime.sh /etc/my_init.d/logtime.sh
RUN chmod +x /etc/my_init.d/logtime.sh
CMD ["/sbin/my_init"]
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
logtime.sh:
#!/bin/sh
date > /tmp/boottime.txt
Console:
$ docker run fd7090916418
time="2017-04-09T15:44:50+02:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/logtime.sh...
*** /etc/my_init.d/logtime.sh failed with status 127
*** Killing all processes...
from baseimage-docker.
Did you try it in Linux? It appears you are running in Windows. I would like to see if the issue persists in Linux.
Try installing Virtualbox and then Vagrant, then type the following commands inside a new, empty folder:
vagrant init travisrowland/centos7
vagrant up
Add your Dockerfile
and logtime.sh
files to that folder, then type these commands:
vagrant ssh
cd /vagrant
docker build .
docker run
Please let me know how that works out, thanks!
from baseimage-docker.
I tried it on my Amazon Linux and It's working. Thank you very much.
from baseimage-docker.
After a few successful tries the problem reappeared on Amazon Linux.
I tried deleting all images and rebuilding - without any success.
I created a new instance and it's working there but I presume it won't work for long.
from baseimage-docker.
Can we do a Hangouts session to try and figure out what's going on?
from baseimage-docker.
from baseimage-docker.
Thanks for letting us know! 👍
from baseimage-docker.
Related Issues (20)
- You should probably simply the docs to show the memcached example very early on HOT 3
- We now have a Discord server!
- Changelog for `focal-1.1.0` HOT 3
- hi. rocky8 or centos8 not support? HOT 3
- Change container builder from Docker to Buildah/Podman HOT 5
- There is a missing tag for focal-1.1.0 HOT 5
- pull error HOT 3
- Is the version of 0.10.2 alreadly outdated..? HOT 2
- apt does not work HOT 7
- syslog-ng warning HOT 2
- User inside the container HOT 9
- Timezone change HOT 2
- The docker pull command on the hub.docker.com page doesn't work HOT 1
- Security vulnerabilities HOT 6
- Docker Hub and Free Team Organisations HOT 1
- Base on Ubuntu 22.04 LTS? HOT 1
- Where did the MASTER tag go?
- package architecture (amd64) does not match system (arm64) on Macbook M2 HOT 1
- how to enable sshd in baseimage? HOT 2
- Status of jammy-1.0.2 build HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baseimage-docker.