Browse Source

Update Dockerfile & build script and add /etc/nsswitch.conf:

- Add nsswitch.conf to configure LibC Name Service inside the container
- Change my email in the Dockerfile
- Update build script to install software as a `build-deps` virtual package so that adding a package to it will be automatically	removed at the end of the build script
for-closed-social
Jean-Philippe Roemer 8 years ago
parent
commit
9032bd097b
4 changed files with 26 additions and 4 deletions
  1. +4
    -1
      Dockerfile
  2. +4
    -1
      Dockerfile.rpi
  3. +2
    -2
      docker/build.sh
  4. +16
    -0
      docker/nsswitch.conf

+ 4
- 1
Dockerfile View File

@ -1,5 +1,5 @@
FROM alpine:3.2 FROM alpine:3.2
MAINTAINER roemer.jp@gmail.com
MAINTAINER jp@roemer.im
# Install system utils & Gogs runtime dependencies # Install system utils & Gogs runtime dependencies
ADD https://github.com/tianon/gosu/releases/download/1.6/gosu-amd64 /usr/sbin/gosu ADD https://github.com/tianon/gosu/releases/download/1.6/gosu-amd64 /usr/sbin/gosu
@ -15,6 +15,9 @@ COPY . /app/gogs/
WORKDIR /app/gogs/ WORKDIR /app/gogs/
RUN ./docker/build.sh RUN ./docker/build.sh
# Configure LibC Name Service
COPY docker/nsswitch.conf /etc/nsswitch.conf
# Configure Docker Container # Configure Docker Container
VOLUME ["/data"] VOLUME ["/data"]
EXPOSE 22 3000 EXPOSE 22 3000

+ 4
- 1
Dockerfile.rpi View File

@ -1,5 +1,5 @@
FROM sander85/rpi-alpine:latest FROM sander85/rpi-alpine:latest
MAINTAINER roemer.jp@gmail.com, raxetul@gmail.com
MAINTAINER jp@roemer.im, raxetul@gmail.com
# Install system utils & Gogs runtime dependencies # Install system utils & Gogs runtime dependencies
ADD https://github.com/tianon/gosu/releases/download/1.6/gosu-armhf /usr/sbin/gosu ADD https://github.com/tianon/gosu/releases/download/1.6/gosu-armhf /usr/sbin/gosu
@ -15,6 +15,9 @@ COPY . /app/gogs/
WORKDIR /app/gogs/ WORKDIR /app/gogs/
RUN ./docker/build.sh RUN ./docker/build.sh
# Configure LibC Name Service
COPY docker/nsswitch.conf /etc/nsswitch.conf
# Configure Docker Container # Configure Docker Container
VOLUME ["/data"] VOLUME ["/data"]
EXPOSE 22 3000 EXPOSE 22 3000

+ 2
- 2
docker/build.sh View File

@ -7,7 +7,7 @@ export GOPATH=/tmp/go
export PATH=${PATH}:${GOPATH}/bin export PATH=${PATH}:${GOPATH}/bin
# Install build deps # Install build deps
apk -U --no-progress add linux-pam-dev go@community gcc musl-dev
apk -U --no-progress add --virtual build-deps linux-pam-dev go@community gcc musl-dev
# Init go environment to build Gogs # Init go environment to build Gogs
mkdir -p ${GOPATH}/src/github.com/gogits/ mkdir -p ${GOPATH}/src/github.com/gogits/
@ -20,7 +20,7 @@ go build -tags "sqlite cert pam"
rm -r $GOPATH rm -r $GOPATH
# Remove build deps # Remove build deps
apk --no-progress del linux-pam-dev go gcc musl-dev
apk --no-progress del build-deps
# Create git user for Gogs # Create git user for Gogs
adduser -H -D -g 'Gogs Git User' git -h /data/git -s /bin/bash && passwd -u git adduser -H -D -g 'Gogs Git User' git -h /data/git -s /bin/bash && passwd -u git

+ 16
- 0
docker/nsswitch.conf View File

@ -0,0 +1,16 @@
# /etc/nsswitch.conf
passwd: compat
group: compat
shadow: compat
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis

Loading…
Cancel
Save