Dockerfile 1.52 KB
Newer Older
1
FROM ubuntu:20.04
2
MAINTAINER GitLab Inc. <support@gitlab.com>
3

4
SHELL ["/bin/sh", "-c"]
5

6
7
8
# Default to supporting utf-8
ENV LANG=C.UTF-8

9
10
11
# Install required packages
RUN apt-get update -q \
    && DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
12
      busybox \
13
14
      ca-certificates \
      openssh-server \
15
      tzdata \
16
      wget \
17
    && rm -rf /var/lib/apt/lists/*
18

19
20
# Use BusyBox
ENV EDITOR /bin/vi
J0WI's avatar
J0WI committed
21
22
23
24
25
26
27
RUN busybox --install \
    && { \
        echo '#!/bin/sh'; \
        echo '/bin/vi "$@"'; \
    } > /usr/local/bin/busybox-editor \
    && chmod +x /usr/local/bin/busybox-editor \
    && update-alternatives --install /usr/bin/editor editor /usr/local/bin/busybox-editor 1
28

29
30
31
32
# Remove MOTD
RUN rm -rf /etc/update-motd.d /etc/motd /etc/motd.dynamic
RUN ln -fs /dev/null /run/motd.dynamic

33
34
35
# Copy assets
COPY RELEASE /
COPY assets/ /assets/
36
37
# as gitlab-ci checks out with mode 666 we need to set permissions of the files we copied into the
# container to a secure value. Issue #5956
38
39
RUN chmod -R og-w /assets RELEASE ; \
  /assets/setup
40
41
42
43

# Allow to access embedded tools
ENV PATH /opt/gitlab/embedded/bin:/opt/gitlab/bin:/assets:$PATH

Kamil Trzciński's avatar
Kamil Trzciński committed
44
# Resolve error: TERM environment variable not set.
45
ENV TERM xterm
Kamil Trzciński's avatar
Kamil Trzciński committed
46

47
48
49
50
51
52
53
54
# Expose web & ssh
EXPOSE 443 80 22

# Define data volumes
VOLUME ["/etc/gitlab", "/var/opt/gitlab", "/var/log/gitlab"]

# Wrapper to handle signal, trigger runit and reconfigure GitLab
CMD ["/assets/wrapper"]
55
56

HEALTHCHECK --interval=60s --timeout=30s --retries=5 \
57
CMD /opt/gitlab/bin/gitlab-healthcheck --fail --max-time 10