4
4
#
5
5
# Don't install anything in this Dockerfile which isn't also present in that environment!
6
6
# Instead, further packages must be installed through explicit build steps.
7
- # This practice keeps builds within docker environments (i.e. codespaces) in lock-step
8
- # with what GitHub Actions CI produces .
7
+ # This practice keeps builds within devcontainer environments (i.e. codespaces) in lock-step
8
+ # with what works in GitHub Actions CI.
9
9
FROM ubuntu:20.04
10
10
11
11
# # Set a configured locale.
12
12
ARG LOCALE=en_US.UTF-8
13
13
14
14
# See the package list in the GitHub reference link above, at the very bottom,
15
15
# which lists installed apt packages.
16
- RUN apt-get update -y \
17
- && apt-get upgrade -y \
18
- && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
16
+ RUN apt update -y \
17
+ && apt upgrade -y \
18
+ && DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y \
19
19
bash-completion \
20
20
build-essential \
21
21
ca-certificates \
22
22
clang-12 \
23
23
curl \
24
+ docker-compose \
25
+ docker.io \
24
26
git \
25
27
gnupg2 \
26
28
iproute2 \
27
29
jq \
30
+ less \
28
31
libclang-12-dev \
29
32
libncurses5-dev \
30
33
libreadline-dev \
@@ -33,7 +36,6 @@ RUN apt-get update -y \
33
36
locales \
34
37
net-tools \
35
38
netcat \
36
- nodejs \
37
39
npm \
38
40
openssh-client \
39
41
pkg-config \
@@ -44,16 +46,31 @@ RUN apt-get update -y \
44
46
sudo \
45
47
tcpdump \
46
48
unzip \
49
+ vim-tiny \
47
50
wget \
48
51
zip
49
52
50
- # # Install Rust. This is pasted from:
51
- # # https://github.com/rust-lang/docker-rust/blob/master/1.51.0/bullseye/Dockerfile
53
+ # Install package sources for google-cloud-sdk repository.
54
+ # Run `gcloud auth application-default login` to enable key management with the `sops` tool.
55
+ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
56
+ && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
57
+ # Install package source for more recent Nodejs packages.
58
+ RUN echo "Add NodeSource keyring for more recent nodejs packages" \
59
+ && export NODE_KEYRING=/usr/share/keyrings/nodesource.gpg \
60
+ && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee "$NODE_KEYRING" >/dev/null \
61
+ && gpg --no-default-keyring --keyring "$NODE_KEYRING" --list-keys \
62
+ && echo "deb [signed-by=$NODE_KEYRING] https://deb.nodesource.com/node_14.x bullseye main" | tee /etc/apt/sources.list.d/nodesource.list
63
+ # Install google-cloud-sdk and nodejs.
64
+ RUN apt update -y \
65
+ && apt install google-cloud-sdk nodejs --no-install-recommends -y \
66
+ && apt auto-remove -y
52
67
68
+ # # Install Rust. This is pasted from:
69
+ # # https://github.com/rust-lang/docker-rust/blob/master/1.57.0/bullseye/Dockerfile
53
70
ENV RUSTUP_HOME=/usr/local/rustup \
54
71
CARGO_HOME=/usr/local/cargo \
55
72
PATH=/usr/local/cargo/bin:$PATH \
56
- RUST_VERSION=1.54 .0
73
+ RUST_VERSION=1.57 .0
57
74
58
75
RUN set -eux; \
59
76
dpkgArch="$(dpkg --print-architecture)" ; \
@@ -82,9 +99,9 @@ RUN rustup set profile default \
82
99
&& rustup component add clippy rustfmt rust-docs
83
100
84
101
# # Install Go.
85
- # # TODO(johnny): Downgrade from 1.16.7 => 1.16.6 (#191)
86
- ARG GOLANG_VERSION=1.16.6
87
- ARG GOLANG_SHA256=be333ef18b3016e9d7cb7b1ff1fdb0cac800ca0be4cf2290fe613b3d069dfe0d
102
+ # # See releases and SHAs at: https://go.dev/dl/
103
+ ARG GOLANG_VERSION=1.17.5
104
+ ARG GOLANG_SHA256=bd78114b0d441b029c8fe0341f4910370925a4d270a6a590668840675b0c653e
88
105
ENV PATH=/usr/local/go/bin:$PATH
89
106
90
107
RUN curl -L -o /tmp/golang.tgz \
@@ -96,25 +113,14 @@ RUN curl -L -o /tmp/golang.tgz \
96
113
&& rm /tmp/golang.tgz \
97
114
&& go version
98
115
99
- # # Install Docker.
100
- ARG DOCKER_VERSION=19.03.13
101
- ARG DOCKER_SHA256=ddb13aff1fcdcceb710bf71a210169b9c1abfd7420eeaf42cf7975f8fae2fcc8
102
-
103
- RUN curl -L -o /tmp/docker.tgz \
104
- https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz \
105
- && echo "${DOCKER_SHA256} /tmp/docker.tgz" | sha256sum -c - \
106
- && tar --extract \
107
- --file /tmp/docker.tgz \
108
- --strip-components 1 \
109
- --directory /usr/local/bin/ \
110
- && rm /tmp/docker.tgz \
111
- && docker --version
112
-
113
116
RUN locale-gen ${LOCALE}
114
117
118
+ # Allow `flow` user to sudo within the container.
115
119
RUN useradd flow --create-home --shell /usr/sbin/nologin \
116
120
&& echo flow ALL=\( root\) NOPASSWD:ALL > /etc/sudoers.d/flow \
117
121
&& chmod 0440 /etc/sudoers.d/flow
122
+ # Go binaries built by `flow` should be on the PATH.
123
+ ENV PATH=/home/flow/go/bin:$PATH
118
124
119
125
# Adapted from: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/docker-from-docker#adding-the-user-to-a-docker-group
120
126
COPY docker-debian.sh /tmp
0 commit comments