Skip to content

Commit

Permalink
Merge pull request #16 from opaduchak/ENG-5603
Browse files Browse the repository at this point in the history
Updated docker image to manifest v2 and replace glide with go's native manager
  • Loading branch information
cslzchen authored May 21, 2024
2 parents e830cf1 + c10ee8e commit 688bc24
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 72 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.

24.0.0 (2024-05-20)
===================

- Glide was replaced with go's built-in dependency manager
- Docker image was upgraded to use go 1.22
- Dockerfile was restructured using multi stage build, which reduced image size from 400+mb to 20mb
- Manifest v2 schema 2 was used to be compatible with newer docker versions
- Update readme

19.0.1 (2019-08-20)
===================

Expand Down
27 changes: 8 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
FROM golang:1

ENV GLIDE_VERSION 0.12.2
ENV GLIDE_SHA256 edd398b4e94116b289b9494d1c13ec2ea37386bad4ada91ecc9825f96b12143c
RUN apt-get update \
&& apt-get install -y \
curl \
&& curl -o /tmp/glide.tar.gz -SL "https://github.com/Masterminds/glide/releases/download/v$GLIDE_VERSION/glide-v$GLIDE_VERSION-linux-$(dpkg --print-architecture).tar.gz" \
&& echo "$GLIDE_SHA256 /tmp/glide.tar.gz" | sha256sum -c - \
&& tar -xzf /tmp/glide.tar.gz -C /usr/local/bin --strip-components=1 \
&& chmod +x /usr/local/bin/glide \
&& rm /tmp/glide.tar.gz \
&& apt-get clean \
&& apt-get autoremove -y \
curl \
&& rm -rf /var/lib/apt/lists/*
FROM golang:1.22-alpine as build


COPY ./ /go/src/github.com/CenterForOpenScience/fakecas

Expand All @@ -24,8 +10,11 @@ ARG GIT_TAG=
ENV GIT_TAG ${GIT_TAG}

RUN cd /go/src/github.com/CenterForOpenScience/fakecas \
&& glide install \
&& VERSION=${GIT_TAG} make \
&& mv /go/src/github.com/CenterForOpenScience/fakecas/fakecas /usr/local/bin/
&& go mod download \
&& VERSION=${GIT_TAG} go build -o fakecas

FROM alpine:3.19 as runtime

COPY --from=build /go/src/github.com/CenterForOpenScience/fakecas/fakecas /usr/local/bin/

CMD ["fakecas"]
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ If you need the `develop` one, use `quay.io/centerforopenscience/fakecas:develop

## Pre-docker-compose

Starting [19.0.0](https://github.com/CenterForOpenScience/fakecas/milestone/1), fakeCAS no longer provides downloadable binrary executables. Here is the last version [0.11.1](https://github.com/CenterForOpenScience/fakecas/releases/tag/0.11.1) that provides such a binary. However, the binary does not work with OSF starting [19.23.0](https://github.com/CenterForOpenScience/osf.io/releases/tag/19.23.0).
Starting [19.0.0](https://github.com/CenterForOpenScience/fakecas/milestone/1), fakeCAS no longer provides downloadable binary executables. Here is the last version [0.11.1](https://github.com/CenterForOpenScience/fakecas/releases/tag/0.11.1) that provides such a binary. However, the binary does not work with OSF starting [19.23.0](https://github.com/CenterForOpenScience/osf.io/releases/tag/19.23.0).

# Develop fakeCAS

Please take a look at the [Dockerfile](https://github.com/cslzchen/fakecas/blob/develop/Dockerfile) for how to develop fakeCAS locally. On macOS, use [`brew`](https://github.com/Homebrew/brew) to install [`go`](https://github.com/golang/go) and [`glide`](https://github.com/Masterminds/glide).
Please take a look at the [Dockerfile](https://github.com/cslzchen/fakecas/blob/develop/Dockerfile) for how to develop fakeCAS locally. On macOS, use [`brew`](https://github.com/Homebrew/brew) to install [`go`](https://github.com/golang/go).
After installing go, pull dependencies using `go install` and run fakeCAS locally unsing `go run ./fakeCas.go`
43 changes: 0 additions & 43 deletions glide.lock

This file was deleted.

8 changes: 0 additions & 8 deletions glide.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module fakecas

go 1.22.2

require (
github.com/labstack/echo v3.3.10+incompatible
github.com/lib/pq v1.10.9
)

require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
)
35 changes: 35 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg=
github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit 688bc24

Please sign in to comment.