Skip to content

Commit

Permalink
Merge pull request #2664 from fetchai/fix/docker_images_ci_automataion
Browse files Browse the repository at this point in the history
docker images automation for CI
  • Loading branch information
5A11 authored Nov 10, 2021
2 parents 5e5850a + 02fba32 commit 0fe0060
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/upload_docker_images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and upload develop-image to docker hub

on:
push:
branches: [ main ]

jobs:
build:
env:
BASE_TAG: fetchai/aea-develop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up tag
run: echo export TAG=${BASE_TAG}:$(python3 -c "from setup import about; print(about[\"__version__\"])") > env.sh
- name: docker login
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Build the Docker image
run: |
source env.sh
docker build . -f ./develop-image/Dockerfile --tag $TAG
- name: Tag to latest
run: |
source env.sh
docker tag $TAG $BASE_TAG:latest
- name: Docker Push
run: |
source env.sh
docker push $TAG
docker push $BASE_TAG:latest
10 changes: 5 additions & 5 deletions develop-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:19.10
FROM ubuntu:20.04

RUN apt-get update && \
apt-get install -y dialog && \
Expand All @@ -18,8 +18,7 @@ RUN HOME=/home/default && \
usermod -a -G sudo default && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers


RUN apt-get install -y \
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
software-properties-common \
vim \
Expand Down Expand Up @@ -49,18 +48,19 @@ ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8

RUN apt-get install -y tox
RUN python3.7 -m pip install -U pipenv
RUN python3 -m pip install -U pipenv==2021.5.29

ENV PATH="/usr/local/bin:${PATH}"
USER default

RUN sudo mkdir /build
WORKDIR /build
COPY . /build
RUN sudo chown -R default /build

RUN sudo make clean

RUN pipenv --python python3.7
RUN pipenv --python python3.8
RUN pipenv run pip3 install --upgrade pip
RUN pipenv install --dev --skip-lock
RUN pipenv run pip3 install .[all]
Expand Down

0 comments on commit 0fe0060

Please sign in to comment.