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

Fixing multiple docker issues #386

Merged
merged 5 commits into from
Dec 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ RUN apk update && \
-s /bin/bash \
-u 1000 \
-G git \
git
git && \
echo "git:$(date +%s | sha256sum | base64 | head -c 32)" | chpasswd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to forbid login ? How about passwod -l to lock the password instead ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we need to set a password otherwise OpenSSH complains that the user is locked, e.g.

User git not allowed because account is locked
input_userauth_request: invalid user git

And since we are using Alpine we only got the pretty limited adduser from Busybox.


ENV USER git
ENV GITEA_CUSTOM /data/gitea
Expand All @@ -38,7 +39,4 @@ ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]

COPY docker /

COPY public /app/gitea/public
COPY templates /app/gitea/templates
COPY gitea /app/gitea/gitea
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ build: $(EXECUTABLE)
$(EXECUTABLE): $(SOURCES)
go build -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@

.PHONY: docker
docker:
docker run -ti --rm -v $(CURDIR):/srv/app/src/code.gitea.io/gitea -w /srv/app/src/code.gitea.io/gitea -e TAGS="$(TAGS)" webhippie/golang:edge make clean generate build
docker build -t gitea/gitea:latest .

.PHONY: release
release: release-dirs release-build release-copy release-check

Expand Down
2 changes: 1 addition & 1 deletion docker/etc/s6/openssh/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
[[ -f ./setup ]] && source ./setup

pushd /root > /dev/null
exec su-exec root /usr/sbin/sshd -E /var/log/sshd.log -D
exec su-exec root /usr/sbin/sshd -D
popd
1 change: 0 additions & 1 deletion docker/etc/ssh/sshd_config
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ UseDNS no
AllowAgentForwarding no
AllowTcpForwarding no
PrintMotd no
PrintLastLog no

PermitUserEnvironment yes
PermitRootLogin no
Expand Down