Platform Unsupported Error, TravisCI Does Not Work

Asked 2 years ago, Updated 2 years ago, 113 views

environment

ruby 2.6.5
rails6
MySQL
MacOS with M1 chip

What do you want to solve

Platform unsupported error, travis.yml does not run well.
Also, sudo is deprecated and an error appears if it is ineffective.Do I need to write root permission instead?I'm not sure
Please let me know if anyone understands!
Thank you for your cooperation.

Problems/errors encountered

Enter a description of the image here
Enter a description of the image here

Affected Source Codes

.Travis.yml

language:ruby
os —linux
dist —xenial
sudo —true
services:docker

before_install:
  - docker-compose up --build-d

script:
  - docker-compose exec -- env'RAILS_ENV = test' web rails db:create
  - docker-compose exec -- env'RAILS_ENV = test' web rails db:migrate
  - docker-compose exec -- env'RAILS_ENV = test' web rails db:seed
  - docker-compose exec -- env'RAILS_ENV = test' web rails test

Dockerfile

 FROM ruby: 2.6.5

RUN apt-get update & apt-get install-y curlapt-transport - https wget & \
curl-sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add-&&\
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list & \
apt-get update & apt-get install-yarn

RUN apt-get update-qq & apt-get install-y nodejs yarn
RUN mkdir/bridge_app
WORKDIR/fridge_app
COPY Gemfile Gemfile.lock/bridge_app/
ENV BUNDLER_VERSION 2.1.4
RUNgem update --system\
    &gem install bundleer-v$BUNDLER_VERSION\
    & bundle install-j4
COPY./bridge_app

RUN yarn install --check-files
RUN bundle exec rails webpacker:install

ENV PATH $PATH: /usr/local/src/bin

COPY entrypoint.sh/usr/bin/
RUN chmod+x/usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3000

CMD ["rails", "server", "-b", "0.0.0.0" ]

docker-compose.yml

version: '3'
services:
  db:
    image:mysql:5.6
    platform —linux/amd64
    environment:
      MYSQL_ROOT_PASSWORD:password
      MYSQL_DATABASE:root
    ports:
      - "3306:3306"
    volumes:
      - ./tmp/db:/var/lib/mysql

  web:
    build:.
    environment:
      region —ap-northeast-1
      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
    command:bash-c "rm-ftmp/pids/server.pid & bundle exec rails s-p 3000-b '0.0.0'"
    volumes:
      - .:/bridge_app
    ports:
      - "3000:3000"
    depend_on:
      - db

docker travis-ci

2022-09-30 18:03

1 Answers

Try writing amd64 instead of x86_64.

https://hub.docker.com/_/mysql?tab=description&page=1&ordering=last_updated

 platform: linux/amd64


2022-09-30 18:03

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.