-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch Docker base image from Ubuntu 18.10 to Debian 10
Closes: #4
- Loading branch information
Showing
9 changed files
with
1,399 additions
and
1,214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
build/* | ||
config/keys/* | ||
config/env/* | ||
config/container/Dockerfile.* | ||
config/container/Dockerfile-* | ||
release/* | ||
.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{{ "# This file was generated using a Jinja2 template." }} | ||
{{ "# Please make your changes in `Dockerfile.j2` and then `make` the individual Dockerfile's." }} | ||
|
||
{% if "golang" in tags %} | ||
ARG GOLANG_IMAGE_REF=@sha256:84349ee862d8bafff35e0d2bfd539da565b536b4dfce654773fc21a1db2da6d7 | ||
{% endif %} | ||
ARG DEBIAN_IMAGE_REF=@sha256:8414aa82208bc4c2761dc149df67e25c6b8a9380e5d8c4e7b5c84ca2d04bb244 | ||
|
||
{% if "golang" in tags %} | ||
FROM golang${GOLANG_IMAGE_REF} as golang | ||
|
||
ARG FIXUID_GIT_REF="0ec93d22e52bde5b7326e84cb62fd26a3d20cead" | ||
ARG OZZOCONFIG_GIT_REF="0ff174cf5aa6480026e0b40c14fd9cfb61c4abf6" | ||
ARG JSONPREPROCESS_GIT_REF="a4e954386171be645f1eb7c41865d2624b69259d" | ||
ARG TOML_GIT_REF="3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005" | ||
ARG YAMLV2_GIT_REF="51d6538a90f86fe93ac480b35f37b2be17fef232" | ||
ARG GLIDE_GIT_REF="b94b39d657d8abcccba6545e148f1201aee6ffec" | ||
|
||
RUN apk add bash git make | ||
|
||
RUN printf "\ | ||
github.com/boxboat/fixuid.git github.com/boxboat/fixuid ${FIXUID_GIT_REF} \n\ | ||
github.com/go-ozzo/ozzo-config github.com/go-ozzo/ozzo-config ${OZZOCONFIG_GIT_REF} \n\ | ||
github.com/hnakamur/jsonpreprocess github.com/hnakamur/jsonpreprocess ${JSONPREPROCESS_GIT_REF} \n\ | ||
github.com/BurntSushi/toml github.com/BurntSushi/toml ${TOML_GIT_REF} \n\ | ||
github.com/go-yaml/yaml gopkg.in/yaml.v2 ${YAMLV2_GIT_REF} \n" \ | ||
> /go/src/repos | ||
|
||
RUN echo ' \ | ||
set -o nounset -o pipefail -o errexit; \ | ||
cat /go/src/repos | while read -r line; do \ | ||
repo=$(echo $line | awk "{ print \$1 }"); \ | ||
folder=$(echo $line | awk "{ print \$2 }"); \ | ||
ref=$(echo $line | awk "{ print \$3 }"); \ | ||
git clone "https://${repo}" "/go/src/${folder}"; \ | ||
git -C "/go/src/${folder}" checkout ${ref}; \ | ||
done' \ | ||
| bash | ||
|
||
RUN go build -o /usr/local/bin/fixuid github.com/boxboat/fixuid | ||
{% endif %} | ||
|
||
|
||
FROM debian:buster${DEBIAN_IMAGE_REF} | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
{% if "golang" in tags %} | ||
COPY --from=golang /usr/local/bin/ /usr/local/bin/ | ||
{% endif %} | ||
|
||
ENV HOME=/home/build | ||
ENV PATH=/home/build/scripts:/opt/aosp-build/scripts:/home/build/out/host/linux-x86/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
ENV LANG=C.UTF-8 \ | ||
TZ=UTC \ | ||
TERM=xterm-256color | ||
|
||
ADD config/container/sources.list /etc/apt/sources.list | ||
{% if "latest" in tags %} | ||
ADD config/container/packages.list /etc/apt/packages.list | ||
{% else %} | ||
ADD config/container/packages-pinned.list /etc/apt/packages.list | ||
{% endif %} | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y $(grep -v '^#' /etc/apt/packages.list) \ | ||
&& sed --in-place '/en_US.UTF-8/s/^#\s*//;' /etc/locale.gen \ | ||
&& dpkg-reconfigure locales \ | ||
&& update-locale LANG=en_US.UTF-8 \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
ADD config /opt/aosp-build/config | ||
ADD scripts /opt/aosp-build/scripts | ||
|
||
RUN useradd -G plugdev,sudo -ms /bin/bash build \ | ||
&& chown -R build:build /home/build \ | ||
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
|
||
{% if "golang" in tags %} | ||
RUN chown root:root /usr/local/bin/fixuid \ | ||
&& chmod 4755 /usr/local/bin/fixuid \ | ||
&& mkdir -p /etc/fixuid \ | ||
&& printf "user: build\ngroup: build\npaths:\n - /\n - /home/build/build\n" > /etc/fixuid/config.yml | ||
|
||
ENTRYPOINT ["/usr/local/bin/fixuid", "-q"] | ||
{% endif %} | ||
|
||
WORKDIR /home/build | ||
|
||
CMD [ "/bin/bash", "/usr/local/bin/build" ] | ||
|
||
USER build |
Oops, something went wrong.