Skip to content

Commit e9e529f

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 4b7834a + 4a85c31 commit e9e529f

6 files changed

Lines changed: 193 additions & 58 deletions

File tree

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
# Publish `main` as Docker `latest` image.
6+
branches:
7+
- main
8+
# Publish `v1.2.3` tags as releases.
9+
tags:
10+
- v*
11+
# Run tests for any PRs against the main branch.
12+
pull_request:
13+
branches:
14+
- main
15+
16+
env:
17+
IMAGE_NAME: go-dev
18+
19+
jobs:
20+
# Run tests.
21+
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
22+
test:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
28+
- name: Build container
29+
run: |
30+
if [ -f docker-compose.test.yml ]; then
31+
docker-compose --file docker-compose.test.yml build
32+
else
33+
make build
34+
fi
35+
36+
- name: Run tests
37+
run: |
38+
if [ -f docker-compose.test.yml ]; then
39+
docker-compose --file docker-compose.test.yml run sut
40+
else
41+
make test
42+
fi
43+
44+
# Push image to GitHub Packages, Docker Hub, and quay.io.
45+
# Microsoft Container Registry (MCR) packaging and publishing is handled by
46+
# an Azure Pipelines job.
47+
# See also https://docs.docker.com/docker-hub/builds/
48+
push:
49+
# Ensure test job passes before pushing image.
50+
needs: test
51+
52+
runs-on: ubuntu-latest
53+
if: github.event_name == 'push'
54+
55+
steps:
56+
- uses: actions/checkout@v2
57+
58+
- name: Build image
59+
run: docker build rootfs --tag $IMAGE_NAME
60+
61+
- name: Log into GitHub package registry
62+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
63+
64+
- name: Push image to GitHub package registry
65+
run: |
66+
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
67+
68+
# Change all uppercase to lowercase
69+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
70+
71+
# Strip git ref prefix from version
72+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
73+
74+
# Use Docker `latest` tag convention
75+
[ "$VERSION" == "main" ] && VERSION=latest
76+
77+
echo IMAGE_ID=$IMAGE_ID
78+
echo VERSION=$VERSION
79+
80+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
81+
docker push $IMAGE_ID:$VERSION
82+
83+
- name: Log into Docker Hub
84+
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKERHUB_USER }} --password-stdin
85+
86+
- name: Push image to Docker Hub
87+
run: |
88+
GITHUB_ORG=$(echo "${{ github.repository }}" | sed -e 's#/.*##')
89+
IMAGE_ID=$GITHUB_ORG/$IMAGE_NAME
90+
91+
# Change all uppercase to lowercase
92+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
93+
94+
# Strip git ref prefix from version
95+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
96+
97+
# Use Docker `latest` tag convention
98+
[ "$VERSION" == "main" ] && VERSION=latest
99+
100+
echo IMAGE_ID=$IMAGE_ID
101+
echo VERSION=$VERSION
102+
103+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
104+
docker push $IMAGE_ID:$VERSION
105+
106+
- name: Log into quay.io
107+
run: echo "${{ secrets.QUAYIO_PASSWORD }}" | docker login quay.io -u ${{ secrets.QUAYIO_USER }} --password-stdin
108+
109+
- name: Push image to quay.io
110+
run: |
111+
GITHUB_ORG=$(echo "${{ github.repository }}" | sed -e 's#/.*##')
112+
IMAGE_ID=quay.io/$GITHUB_ORG/$IMAGE_NAME
113+
114+
# Change all uppercase to lowercase
115+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
116+
117+
# Strip git ref prefix from version
118+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
119+
120+
# Use Docker `latest` tag convention
121+
[ "$VERSION" == "main" ] && VERSION=latest
122+
123+
echo IMAGE_ID=$IMAGE_ID
124+
echo VERSION=$VERSION
125+
126+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
127+
docker push $IMAGE_ID:$VERSION

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION := $(shell git describe --tags --exact-match 2>/dev/null || echo latest)
1+
VERSION ?= $(shell git describe --tags --exact-match 2>/dev/null || echo latest)
22
REGISTRY ?= quay.io/
33
IMAGE_PREFIX ?= deis
44
IMAGE := ${REGISTRY}${IMAGE_PREFIX}/go-dev:${VERSION}

README.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# deis/go-dev
22

3-
[![Build Status](https://travis-ci.org/deis/docker-go-dev.svg?branch=master)](https://travis-ci.org/deis/docker-go-dev) [![Docker Repository on Quay](https://quay.io/repository/deis/go-dev/status "Docker Repository on Quay")](https://quay.io/repository/deis/go-dev)
3+
[![Build Status](https://github.com/deis/docker-go-dev/actions/workflows/docker-publish.yml/badge.svg)](https://quay.io/repository/deis/go-dev?tab=tags)
44

55
A [Go][] language development toolbox.
66

@@ -13,16 +13,12 @@ creating [issues][] and submitting [pull requests][].
1313
* based on [Ubuntu 18.04][]
1414
* [az][]: Azure cloud command-line tool
1515
* [azcopy][]: Utility for copying data to/from Microsoft Azure Blob and File storage
16-
* [dep][]: Go dependency management tool
1716
* [delve][]: debugger for the Go programming language
1817
* [Docker][]: Docker binaries to be able to bind mount /var/run/docker.sock in the dev environment container
19-
* [gb][]: project-based build tool for Go
2018
* [ginkgo][]: BDD testing framework for Go
21-
* [glide][]: Go dependency management tool
2219
* [go-bindata][]: converts any file into Go source code
23-
* [golint][]: Go source code linter
24-
* [gometalinter][]: run Go lint tools concurrently
2520
* [golangci-lint][]: concurrent runner for Go linting tools
21+
* [goss][]: YAML-based tool for validating a server's configuration
2622
* [gox][]: simple Go cross-compiling tool
2723
* [helm][]: Kubernetes package manager
2824
* [jq][]: command-line JSON processor
@@ -39,21 +35,30 @@ creating [issues][] and submitting [pull requests][].
3935
* [upx][]: executable packer
4036
* [vim][]: text editor
4137
* [wamerican][]: American English dictionary words for /usr/share/dict
38+
4239
## Usage
4340

4441
Mount your local Go code into a container's `$GOPATH` to run any `go` command or one of the
45-
included tools or scripts. Here's an example of running `glide up` for deis/builder:
42+
included tools or scripts. Here's an example of running `ginko` for deis/builder:
4643

4744
```console
4845
$ docker run --rm \
4946
--volume $GOPATH/src/github.com/deis/builder:/go/src/github.com/deis/builder \
5047
--workdir /go/src/github.com/deis/builder \
5148
quay.io/deis/go-dev:latest \
52-
glide up
49+
ginkgo -r
5350
```
5451

52+
## Releases
53+
5554
The latest deis/go-dev Docker image is available at:
5655

56+
* [Microsoft Container Registry][]
57+
```
58+
docker pull mcr.microsoft.com/oss/azcu/go-dev:<tag>
59+
```
60+
Browse the [go-dev index URL][] to see which tags are available.
61+
5762
* [Quay.io][]
5863
```
5964
docker pull quay.io/deis/go-dev
@@ -64,28 +69,44 @@ The latest deis/go-dev Docker image is available at:
6469
docker pull deis/go-dev
6570
```
6671

72+
To publish a new release of deis/go-dev, use the [deisrel][] tool:
73+
74+
```console
75+
$ deisrel release docker-go-dev v1.28.7
76+
Doing a dry run of the component release...
77+
78+
Creating changelog for docker-go-dev with tag v1.28.6 through commit 1a69c5502ef1bca014fbd3581451d1421829a42f
79+
80+
81+
### v1.28.6 -> v1.28.7
82+
...
83+
```
84+
85+
If the CHANGELOG contents look correct, run the same command again but add the argument `--dry-run=false`.
86+
You will be prompted to confirm again before any tag or release is written to GitHub.
87+
88+
6789
[az]: https://github.com/Azure/azure-cli#readme
6890
[azcopy]: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-linux?toc=%2fazure%2fstorage%2ffiles%2ftoc.json
69-
[delve]: https://github.com/derekparker/delve
70-
[dep]: https://github.com/golang/dep
91+
[deisrel]: https://github.com/deis/deisrel
92+
[delve]: https://github.com/go-delve/delve
7193
[Docker Hub]: https://hub.docker.com
7294
[Docker]: http://www.docker.com
73-
[gb]: https://github.com/constabulary/gb/
7495
[gen-changelog.sh]: https://github.com/deis/docker-go-dev/tree/master/rootfs/usr/local/bin/gen-changelog.sh
7596
[ginkgo]: https://github.com/onsi/ginkgo
76-
[glide]: https://github.com/Masterminds/glide
7797
[go-bindata]: https://github.com/jteeuwen/go-bindata
7898
[Go]: https://golang.org/
79-
[golint]: https://github.com/golang/lint
80-
[gometalinter]: https://github.com/alecthomas/gometalinter
99+
[go-dev index URL]: https://mcr.microsoft.com/v2/oss/azcu/go-dev/tags/list
81100
[golangci-lint]: https://github.com/golangci/golangci-lint
101+
[goss]: https://github.com/aelsabbahy/goss
82102
[gox]: https://github.com/mitchellh/gox
83103
[helm]: https://github.com/kubernetes/helm
84104
[issues]: https://github.com/deis/docker-go-dev/issues
85105
[jq]: https://stedolan.github.io/jq/
86106
[jwt]: https://github.com/dgrijalva/jwt-go
87107
[k]: https://github.com/jakepearson/k
88108
[kubectl]: https://kubernetes.io/docs/user-guide/kubectl-overview/
109+
[Microsoft Container Registry]: https://github.com/microsoft/containerregistry
89110
[pull requests]: https://github.com/deis/docker-go-dev/pulls
90111
[Quay.io]: https://quay.io
91112
[Packer]: https://github.com/hashicorp/packer

_scripts/ci/deploy.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

rootfs/Dockerfile

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,22 @@ FROM ubuntu:18.04
33
LABEL name="deis-go-dev" \
44
maintainer="Matt Boersma <matt.boersma@microsoft.com>"
55

6-
ENV AZCLI_VERSION=2.12.1 \
7-
DOCKER_VERSION=19.03.4 \
8-
GO_VERSION=1.15.2 \
9-
GLIDE_VERSION=v0.13.3 \
10-
GLIDE_HOME=/root \
11-
HELM_VERSION=v2.16.12 \
12-
KUBECTL_VERSION=v1.16.3 \
6+
ENV ANSIBLE_VERSION=2.10.9 \
7+
AZCLI_VERSION=2.26.1 \
8+
DOCKER_VERSION=20.10.2 \
139
ETCDCTL_VERSION=v3.1.8 \
14-
GOLANGCI_LINT_VERSION=v1.31.0 \
10+
GO_VERSION=1.16.6 \
11+
GOLANGCI_LINT_VERSION=v1.41.1 \
12+
GOSS_VERSION=v0.3.16 \
13+
HELM_VERSION=3.6.2 \
14+
KUBECTL_VERSION=v1.21.3 \
15+
PACKER_VERSION=1.7.3 \
1516
PROTOBUF_VERSION=3.7.0 \
16-
SHELLCHECK_VERSION=v0.7.1 \
17-
SHFMT_VERSION=3.1.2 \
17+
PYJWT_VERSION=2.1.0 \
18+
PYWINRM_VERSION=0.4.1 \
19+
SHELLCHECK_VERSION=v0.7.2 \
20+
SHFMT_VERSION=3.3.0 \
21+
UPX_VERSION=3.96 \
1822
PATH=$PATH:/usr/local/go/bin:/go/bin:/usr/local/bin/docker \
1923
GOPATH=/go
2024

@@ -26,11 +30,9 @@ RUN \
2630
apt-get update && \
2731
apt-get install -y software-properties-common && \
2832
add-apt-repository ppa:rmescandon/yq && \
29-
apt-add-repository --yes --update ppa:ansible/ansible && \
3033
apt-get update && \
3134
apt-get upgrade -y --no-install-recommends && \
3235
apt-get install -y --no-install-recommends \
33-
ansible \
3436
bash \
3537
build-essential \
3638
ca-certificates \
@@ -54,26 +56,23 @@ RUN \
5456
rsync \
5557
ruby \
5658
unzip \
57-
upx \
5859
util-linux \
5960
vim \
6061
wamerican \
6162
wget \
6263
yq \
6364
zip \
6465
&& curl -L https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz | tar -C /usr/local -xz \
65-
&& curl -sSL https://github.com/Masterminds/glide/releases/download/${GLIDE_VERSION}/glide-${GLIDE_VERSION}-linux-amd64.tar.gz \
66-
| tar -vxz -C /usr/local/bin --strip=1 \
6766
&& curl -sSL -o /tmp/protoc.zip https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip \
6867
&& unzip /tmp/protoc.zip 'bin/protoc' -d /usr/local \
6968
&& rm /tmp/protoc.zip \
7069
&& curl -sSL https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \
7170
&& chmod +x /usr/local/bin/kubectl \
7271
&& mkdir -p ${GOPATH}/src/k8s.io/helm \
73-
&& curl -sSL https://storage.googleapis.com/kubernetes-helm/helm-${HELM_VERSION}-linux-amd64.tar.gz \
74-
| tar -vxz -C /usr/local/bin --strip=1 \
72+
&& curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 \
73+
&& chmod 700 get_helm.sh && ./get_helm.sh --version v${HELM_VERSION} \
74+
&& rm ./get_helm.sh \
7575
&& mkdir -p /go/bin \
76-
&& curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh \
7776
&& curl -sSL https://aka.ms/downloadazcopy-v10-linux | tar -vxz -C /usr/local/bin --strip=1 \
7877
&& mv /usr/local/bin/azcopy /usr/local/bin/azcopy-preview \
7978
&& curl -sSL https://aka.ms/downloadazcopylinux64 | tar -vxz -C /tmp \
@@ -90,24 +89,30 @@ RUN \
9089
&& go get -u -v \
9190
github.com/AlekSi/gocov-xml \
9291
github.com/axw/gocov/gocov \
93-
github.com/constabulary/gb/... \
94-
github.com/derekparker/delve/cmd/dlv \
92+
github.com/go-delve/delve/cmd/dlv \
9593
github.com/dgrijalva/jwt-go/cmd/jwt \
9694
github.com/golang/protobuf/protoc-gen-go \
9795
github.com/haya14busa/goverage \
9896
github.com/jteeuwen/go-bindata/... \
9997
github.com/mitchellh/gox \
10098
github.com/onsi/ginkgo/ginkgo \
101-
github.com/hashicorp/packer \
102-
gopkg.in/alecthomas/gometalinter.v2 \
103-
&& ln -s ${GOPATH}/bin/gometalinter.v2 ${GOPATH}/bin/gometalinter \
104-
&& gometalinter.v2 --install \
10599
&& curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b ${GOPATH}/bin ${GOLANGCI_LINT_VERSION} \
106100
&& curl -sSL https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz \
107101
| tar -vxJ -C /usr/local/bin --strip=1 \
102+
&& curl -sSL https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip -o /tmp/packer.zip \
103+
&& unzip /tmp/packer.zip -d /usr/local/bin \
108104
&& curl -o /usr/local/bin/shfmt -sSL https://github.com/mvdan/sh/releases/download/v{SHFMT_VERSION}/shfmt_v{SHFMT_VERSION}_linux_amd64 \
109105
&& chmod +x /usr/local/bin/shfmt \
110-
&& pip3 install --disable-pip-version-check --no-cache-dir azure-cli==${AZCLI_VERSION} shyaml \
106+
&& curl -L "https://github.com/aelsabbahy/goss/releases/download/${GOSS_VERSION}/goss-linux-amd64" -o /usr/local/bin/goss \
107+
&& chmod +rx /usr/local/bin/goss \
108+
&& curl -L "https://github.com/aelsabbahy/goss/releases/download/${GOSS_VERSION}/dgoss" -o /usr/local/bin/dgoss \
109+
&& chmod +rx /usr/local/bin/dgoss \
110+
&& curl -sSL -o /tmp/upx.tar.xz https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz \
111+
&& tar -xvf /tmp/upx.tar.xz -C /tmp \
112+
&& mv /tmp/upx-${UPX_VERSION}-amd64_linux/upx /usr/local/bin/upx \
113+
&& pip3 install --disable-pip-version-check --no-cache-dir --upgrade pip \
114+
&& pip3 install --disable-pip-version-check --no-cache-dir azure-cli==${AZCLI_VERSION} PyJWT==${PYJWT_VERSION} shyaml ansible-base==${ANSIBLE_VERSION} pywinrm==${PYWINRM_VERSION} \
115+
&& ansible-galaxy collection install ansible.windows \
111116
&& apt-get purge --auto-remove -y libffi-dev python3-dev \
112117
&& apt-get autoremove -y \
113118
&& apt-get clean -y \

0 commit comments

Comments
 (0)