-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (62 loc) · 1.95 KB
/
Dockerfile
File metadata and controls
72 lines (62 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
ARG BASE_IMAGE=alpine:3.10
FROM ${BASE_IMAGE}
# Install deps.
ARG VERSION
RUN set -xe; \
apk add --update --no-cache --virtual .runtime-deps \
ca-certificates \
libffi \
libvirt \
libzmq \
openssh-client \
openssl \
python3 \
tzdata; \
apk add --no-cache --virtual .build-deps \
g++ \
gcc \
libffi-dev \
libvirt-dev \
musl-dev \
openssl-dev \
py3-pip \
python3-dev \
zeromq-dev; \
pip3 install --no-cache-dir "virtualbmc==${VERSION}"; \
apk del .build-deps;
# Create our group & user.
RUN set -xe; \
addgroup -g 1000 -S virtualbmc; \
adduser -u 1000 -S -h /virtualbmc -s /bin/sh -G virtualbmc virtualbmc; \
mkdir -p /virtualbmc/.ssh; \
echo -e "Host *\n StrictHostKeyChecking no\n UserKnownHostsFile=/dev/null\n" > /virtualbmc/.ssh/config; \
chown -R virtualbmc:virtualbmc /virtualbmc/.ssh; \
chmod 0700 /virtualbmc/.ssh; \
chmod 0644 /virtualbmc/.ssh/config;
# Copy our entrypoint into the container.
COPY ./runtime-assets /
# Build arguments.
ARG VCS_REF
ARG BUILD_DATE
# Labels / Metadata.
LABEL \
org.opencontainers.image.authors="James Brink <brink.james@gmail.com>" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.description="VirtualBMC ${VERSION}" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.source="https://github.com/SolidCommand/docker-virtualbmc" \
org.opencontainers.image.title="virtualbmc" \
org.opencontainers.image.vendor="Solid Command" \
org.opencontainers.image.version="${VERSION}"
# Setup our environment variables.
ENV \
PATH="/usr/local/bin:$PATH" \
VERSION="${VERSION}"
# Drop down to our unprivileged user.
USER virtualbmc
# Set our working directory.
WORKDIR /virtualbmc
# Set the entrypoint.
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# Set the default command
CMD ["vbmcd"]