Browse Source

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
Thomas Boerger 3 years ago
parent
commit
c6b6a61bf1
4 changed files with 8 additions and 6 deletions
  1. 2 4
      Dockerfile
  2. 5 0
      Makefile
  3. 1 1
      docker/etc/s6/openssh/run
  4. 0 1
      docker/etc/ssh/sshd_config

+ 2 - 4
Dockerfile

@@ -26,7 +26,8 @@ RUN apk update && \
26 26
     -s /bin/bash \
27 27
     -u 1000 \
28 28
     -G git \
29
-    git
29
+    git && \
30
+  echo "git:$(date +%s | sha256sum | base64 | head -c 32)" | chpasswd
30 31
 
31 32
 ENV USER git
32 33
 ENV GITEA_CUSTOM /data/gitea
@@ -38,7 +39,4 @@ ENTRYPOINT ["/usr/bin/entrypoint"]
38 39
 CMD ["/bin/s6-svscan", "/etc/s6"]
39 40
 
40 41
 COPY docker /
41
-
42
-COPY public /app/gitea/public
43
-COPY templates /app/gitea/templates
44 42
 COPY gitea /app/gitea/gitea

+ 5 - 0
Makefile

@@ -91,6 +91,11 @@ build: $(EXECUTABLE)
91 91
 $(EXECUTABLE): $(SOURCES)
92 92
 	go build -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
93 93
 
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
+
94 99
 .PHONY: release
95 100
 release: release-dirs release-build release-copy release-check
96 101
 

+ 1 - 1
docker/etc/s6/openssh/run

@@ -2,5 +2,5 @@
2 2
 [[ -f ./setup ]] && source ./setup
3 3
 
4 4
 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
6 6
 popd

+ 0 - 1
docker/etc/ssh/sshd_config

@@ -18,7 +18,6 @@ UseDNS no
18 18
 AllowAgentForwarding no
19 19
 AllowTcpForwarding no
20 20
 PrintMotd no
21
-PrintLastLog no
22 21
 
23 22
 PermitUserEnvironment yes
24 23
 PermitRootLogin no