File tree 2 files changed +80
-0
lines changed 2 files changed +80
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : build-push-al2023
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ push :
7
+ description : Push the image to ghcr.io
8
+ required : false
9
+ default : true
10
+ env :
11
+ REGISTRY : ghcr.io
12
+ IMAGE_NAME : " vscode/devcontainers/al2023"
13
+
14
+ jobs :
15
+ build-push :
16
+ runs-on : ubuntu-latest
17
+ permissions :
18
+ contents : read
19
+ packages : write
20
+ steps :
21
+ - uses : docker/setup-buildx-action@v3
22
+
23
+ - uses : docker/metadata-action@v5
24
+ id : meta
25
+ with :
26
+ images : ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.IMAGE_NAME }}
27
+ tags : |
28
+ latest
29
+ ${{ github.event.inputs.UBUNTU_VERSION }}
30
+ labels : |
31
+ org.opencontainers.image.title=AL2023 devcontainer
32
+ org.opencontainers.image.description=VS Code devcontainer: Amazon Linux 2023
33
+
34
+ - uses : docker/login-action@v3
35
+ with :
36
+ registry : ${{ env.REGISTRY }}
37
+ username : ${{ github.actor }}
38
+ password : ${{ secrets.GITHUB_TOKEN }}
39
+
40
+ - uses : docker/build-push-action@v3
41
+ with :
42
+ context : ' {{defaultContext}}:devcontainers/al2023'
43
+ push : ${{ github.event.inputs.push }}
44
+ tags : ${{ steps.meta.outputs.tags }}
45
+ labels : ${{ steps.meta.outputs.labels }}
46
+
Original file line number Diff line number Diff line change
1
+ FROM amazonlinux:2023
2
+
3
+ RUN set -x \
4
+ && yum update \
5
+ && yum -y install \
6
+ bash-completion \
7
+ git \
8
+ gzip \
9
+ jq \
10
+ sudo \
11
+ tar \
12
+ unzip \
13
+ wget \
14
+ && yum clean all
15
+
16
+ # AWS CLI v2 and bash completion
17
+ RUN set -x \
18
+ && curl --silent "https://awscli.amazonaws.com/awscli-exe-linux-$(uname --machine).zip" --output awscliv2.zip \
19
+ && unzip awscliv2.zip \
20
+ && ./aws/install \
21
+ && rm -rf ./aws awscliv2.zip \
22
+ && echo 'complete -C /usr/local/bin/aws_completer aws' >> /etc/bashrc
23
+
24
+ # Settings for root
25
+ RUN set -ux \
26
+ && echo 'complete -C /usr/local/bin/aws_completer aws' >> $HOME/.bashrc
27
+
28
+ # Settings for vscode: authorized sudo user
29
+ ARG USER_NAME=vscode
30
+ RUN set -ux \
31
+ && useradd $USER_NAME \
32
+ && echo "$USER_NAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER_NAME
33
+
34
+ USER $USER_NAME
You can’t perform that action at this time.
0 commit comments