Skip to content

Commit c6b6a61

Browse files
tboergerlunny
authored andcommitted
Fixing multiple docker issues (#386)
* Added stupid docker task to makefile * Dropped unknown option PrintLastLog from docker ssh config * OpenSSH should log to docker stdout * Set random pw for docker git user, otherwise it is locked * Stop using templates and public within docker
1 parent 1831ee2 commit c6b6a61

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ RUN apk update && \
2626
-s /bin/bash \
2727
-u 1000 \
2828
-G git \
29-
git
29+
git && \
30+
echo "git:$(date +%s | sha256sum | base64 | head -c 32)" | chpasswd
3031

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

4041
COPY docker /
41-
42-
COPY public /app/gitea/public
43-
COPY templates /app/gitea/templates
4442
COPY gitea /app/gitea/gitea

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ build: $(EXECUTABLE)
9191
$(EXECUTABLE): $(SOURCES)
9292
go build -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
9393

94+
.PHONY: docker
95+
docker:
96+
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
97+
docker build -t gitea/gitea:latest .
98+
9499
.PHONY: release
95100
release: release-dirs release-build release-copy release-check
96101

docker/etc/s6/openssh/run

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
[[ -f ./setup ]] && source ./setup
33

44
pushd /root > /dev/null
5-
exec su-exec root /usr/sbin/sshd -E /var/log/sshd.log -D
5+
exec su-exec root /usr/sbin/sshd -D
66
popd

docker/etc/ssh/sshd_config

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ UseDNS no
1818
AllowAgentForwarding no
1919
AllowTcpForwarding no
2020
PrintMotd no
21-
PrintLastLog no
2221

2322
PermitUserEnvironment yes
2423
PermitRootLogin no

0 commit comments

Comments
 (0)