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

hexo docker请教 #9

Open
wangweitung opened this issue Sep 5, 2024 · 0 comments
Open

hexo docker请教 #9

wangweitung opened this issue Sep 5, 2024 · 0 comments

Comments

@wangweitung
Copy link

我用以下dockerfile和bootstrap.sh文件构建镜像,但容器启动后,提示不存在,

dockerfile

FROM node:14-alpine

MAINTAINER Newnius <[email protected]>

RUN apk --no-cache add git

RUN npm install --unsafe-perm hexo-cli -g

ADD bootstrap.sh /etc/bootstrap.sh

RUN ls -l /etc/bootstrap.sh

RUN chmod +x /etc/bootstrap.sh

WORKDIR /blog

ENTRYPOINT ["/etc/bootstrap.sh", "development"]

bootstrap.sh

#!/bin/sh

# configure git
git config --global user.email $GIT_EMAIL
git config --global user.name $GIT_NAME

# init hexo if dir is empty
if ! [ "$(ls -A ./ )" ]; then
	hexo init && npm install
fi


# install modules if not
[ -d "node_modules" ] || npm install --from-lockfile

# run hexo as production / developemnt mode
if [[ $1 == "production" ]]; then
	hexo server -s
else
	hexo server
fi

启动后容器日志:

exec /etc/bootstrap.sh: no such file or directory
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

1 participant